server-base

    7.1.29 • Public • Published

    server base

    base for micro services or simple servers

    js-standard-style build status downloads

    usage

    const service = require('server-base')
    service({
      '@setup': (ctx, router) => {
        ctx.use([
          (req, res, next) => next()
        ])
      },
      '/graphql': {
        get (req, res) {
          res.end('html')
        },
        async post (req, res) {
          const query = await req.json()
          res.json({})
        }
      }
    })
    .start(5000)

    router

    See server-base-router for details.

    See server-base-router-tests for details.

    logger

    See server-base-log for details.

    .env

    If a .env file exists it will load the values into process.env using dotenv.

    PORT=1900

    install

    With npm do:

    npm install server-base
    

    license

    Apache License, Version 2.0

    Install

    npm i server-base

    DownloadsWeekly Downloads

    566

    Version

    7.1.29

    License

    Apache-2.0

    Unpacked Size

    26.8 kB

    Total Files

    6

    Last publish

    Collaborators

    • jameskyburz