Skip to content

github-ninad/book-my-time

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nodejs-express

This is a starter kit for nodejs with express. To get started:

Firstly, download the starter-kit 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:

app.post('/greet', (req, res) => {
  return res.json({
    "greeting": "have a nice day"
  });
});

Throwing errors

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.

retun res.status(400).json({
  message: 'invalid email'
});

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published