http framework
npm i theodore
const Theodore = require('theodore')
const app = new Theodore()
app.get('/', (req, res, params) => res.send('hello world', 200))
app.get('/status', (req, res, params) => res.send('OK', 200))
app.get('/cats', (req, res, params) => res.json(['theodore', 'sally', 'glory'], 200))
app.listen()
Create a new server.
Create a route that matches the method and route
.
If the request has a body it will be parsed based on content type and placed in req.body
.
Will set the content type and stringify the JSON for you.
Send a response down the line.