listen

listen is the main function you use to start your server with octoris

circle-info

Listen takes in all the options that the http module server.listen accepts you can check those herearrow-up-right

circle-exclamation

Arguments

Name

Type

Description

routes

Function

A function containing all the routes, this function is created by using composeRoutes

Returns

Type

Description

Promise

A promise object

Usage

const { listen } = require('octoris')

listen({ port: 3000 }, routes)
  .then(addr => console.log(`Server Listening on ${addr}`))
  .catch(console.error)
  

Last updated

Was this helpful?