Skip to content

Instantly share code, notes, and snippets.

@hossain-khan
Created March 13, 2019 03:24
Show Gist options
  • Save hossain-khan/d6a2cfeda99416a232c95e374758e986 to your computer and use it in GitHub Desktop.
Save hossain-khan/d6a2cfeda99416a232c95e374758e986 to your computer and use it in GitHub Desktop.
Express JS API Example
/**
* Say hello API
* Try: https://mock-apis-server.firebaseapp.com/say/hello
*/
app.get('/say/hello', (req, res) => {
// Return success response
return res.status(200).json({"message":"Hello there... Welcome to mock server."});
});
/* [END `/say/hello` ] - must be added before `exports.api = ...` */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment