https://github.com/anshusaurav/slack-app-standup-felicitator-backend
https://github.com/anshusaurav/slack-app-standup-felicitator-backend
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/anshusaurav/slack-app-standup-felicitator-backend
- Owner: anshusaurav
- Created: 2020-10-01T00:13:03.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-09T10:45:47.000Z (over 4 years ago)
- Last Synced: 2025-01-01T10:15:31.420Z (5 months ago)
- Language: JavaScript
- Size: 42 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# nodejs-express
This is a starter kit for `nodejs` with `express`. To get started:
Firstly, [download the starter-kit](https://github.com/hasura/codegen-assets/raw/master/nodejs-express/nodejs-express.zip) and `cd` into it.
```
npm ci
npm start
```## Development
The entrypoint for the server lives in `src/server.js`.
If you wish to add a new route (say `/greet`) , you can add it directly in the `server.js` as:
```js
app.post('/greet', (req, res) => {
return res.json({
"greeting": "have a nice day"
});
});
```### Throwing erros
You can throw an error object or a list of error objects from your handler. The response must be 4xx and the error object must have a string field called `message`.
```js
retun res.status(400).json({
message: 'invalid email'
});
```