function createServer (options, callback) {
  const app = express()

  app.use(cors())
  // For parsing `application/json`.
  app.use(express.json())
  // For parsing `application/x-www-form-urlencoded`.
  app.use(express.urlencoded({ extended: true }))

  // TODO morgan as verbose?
  // app.use(logger('dev'))
  // app.use(logger('combined'))

  // TODO create favicon
  app.use('/favicon.ico', function (req, res) {
    res.sendStatus(200)
  })
  app.use('/', router(options))

  app.listen(options.port, callback)

  return app
}
/**
 * Creates a new server with the given options.
 * @param  {Object}   options  configurable options.
 * @param  {Function} callback function to be called on start.
 * @return {Object}            express app instance.
 */
Creates a new server with the given options.
@param  {Object}   options  configurable options.
@param  {Function} callback function to be called on start.
@return {Object}            express app instance.
Creates a new server with the given options . @param { Object } options configurable options . @param { Function } callback function to be called on start . @return { Object } express app instance .
function createServer (options, callback) {
  const app = express()
  app.use(cors())
  app.use(express.json())
  app.use(express.urlencoded({ extended: true }))
  app.use('/favicon.ico', function (req, res) {
    res.sendStatus(200)
  })
  app.use('/', router(options))
  app.listen(options.port, callback)
  return app
}
function createServer ( options , callback ) { const app = express ( ) app . use ( cors ( ) ) app . use ( express . json ( ) ) app . use ( express . urlencoded ( { extended : true } ) ) app . use ( '/favicon.ico' , function ( req , res ) { res . sendStatus ( 200 ) } ) app . use ( '/' , router ( options ) ) app . listen ( options . port , callback ) return app }
Creates a new server with the given options.
Creates a new server with the given options .
// For parsing `application/json`. // For parsing `application/x-www-form-urlencoded`. // TODO morgan as verbose? // app.use(logger('dev')) // app.use(logger('combined')) // TODO create favicon