listen is the main function you use to start your server with octoris
Last updated 5 years ago
Was this helpful?
Listen takes in all the options that the http module server.listen accepts you can check those
http
server.listen
The only required Option to give listen is the port option
listen
Name
Type
Description
options
Object
routes
Function
A function containing all the routes, this function is created by using composeRoutes
composeRoutes
Promise
A promise object
const { listen } = require('octoris') listen({ port: 3000 }, routes) .then(addr => console.log(`Server Listening on ${addr}`)) .catch(console.error)