⚡
light
  • light
  • guides
    • getting started
    • server vs serverless
    • routes
    • models
    • factories
    • routing
    • plugins
    • middleware
    • query
    • params
    • global
    • error handling
    • hot module reloading (TODO)
    • databases (TODO)
      • mongoose
      • objection/knex
    • testing (TODO)
      • ava
      • jest
    • deployments (TODO)
      • runkit
      • aws
      • now
      • heroku
      • server
      • google cloud
      • azure
      • netlify
    • misc (TODO)
      • apollo/graphql
  • api
    • server({ routes, opts }): object
    • params(path, url): Promise<object>
    • boom
      • Coming soon
    • micro
      • Coming soon
      • Coming soon
      • Coming soon
      • Coming soon
      • Coming soon
      • Coming soon
Powered by GitBook
On this page
  • Output
  • router: object
  • server: Server
  • Parameters
  • routes: string | Route[]
  • opts: object

Was this helpful?

  1. api

server({ routes, opts }): object

Previousapollo/graphqlNextparams(path, url): Promise<object>

Last updated 5 years ago

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 ).

Output

This function returns an object.

{
  router,
  server,
}

router: object

A router object.

server: Server

A HTTP server object which handles all of the routes provided by the routes parameter.

Parameters

This function take an object with a routes and log property.

{
  routes,
  opts,
}

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.

find-my-way
find-my-way