Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Raathigesh committed Aug 15, 2016
2 parents e52318b + 9cdd0d8 commit f334fcf
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ Take a look at the UI of Atmo. http://atmo.surge.sh/ (This demo is just to showc
- [Creating a proxy endpoint](https://github.com/Raathigesh/Atmo/blob/master/docs/ProxyEndpoint.md)
- [Creating a json-server endpoint](https://github.com/Raathigesh/Atmo/blob/master/docs/JsonServerEndpoint.md)
- [Creating a graphql endpoint](https://github.com/Raathigesh/Atmo/blob/master/docs/GraphqlEndpoint.md)
- [Http Endpoint - Conditional Response](https://github.com/Raathigesh/Atmo/blob/master/docs/ConditionalResponseWithHttpEndpoint.md)
- [Generating code](https://github.com/Raathigesh/Atmo/blob/master/docs/GeneratingProjectViaGenerators.md)
- [Deploying a generated project via Zeit's now](https://github.com/Raathigesh/Atmo/blob/master/docs/DeployingViaNow.md)

Expand Down
4 changes: 2 additions & 2 deletions docs/ConditionalResponseWithHttpEndpoint.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# How to send conditional response
# How to send conditional response or handle query parameters
Http endpoints usually sends a specific response back. But what if you want to send conditional response based on query parameters. Atmo allows you to write a piece of code snippet
which runs when the endpoint is accessed. This snippet could decide what response to send back based on conditions.

![Widget Frame](./images/JavascriptSnippet.PNG)

Make sure to select `JavaScript` in the response type and write the JavaScript.

You have access to the express js request and response objects through the `req` and `res` identifiers.
You have access to the express js request and response objects through the `req` and `res` identifiers.

0 comments on commit f334fcf

Please sign in to comment.