server({ routes, opts }): object
Last updated
Was this helpful?
Last updated
Was this helpful?
server
is a function used to take in a path to a set of routes or the code to the routes themselves, generate the router, and return a http server and the respective router object (generated by ).
This function returns an object.
router: object
A router object.
server: Server
A HTTP server object which handles all of the routes provided by the routes
parameter.
This function take an object with a routes
and log
property.
routes: string | Route[]
A string or an array of routes containing the path to folders or the code itself.
opts: object
A hash of options to be sent to the Route class.