-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/Raathigesh/Atmo
- Loading branch information
Showing
2 changed files
with
3 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |