JSPM

  • Created
  • Published
  • Downloads 10
  • Score
    100M100P100Q51341F
  • License MIT

/restserver?method=user.login

Package Exports

  • methor

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (methor) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Methor

NPM Version NPM Downloads Node.js Version

a router style restserver - method

Example

Install

$ npm install methor --save

USAGE

const Methor = require('methor')
const path = require('path')
const app = new Methor({
    port: 3004,
    methods: {
        user
    },
    created({ port, router }) {
        console.log('app started at port %d', port)
        router.get('/logout', (req, res) => {
            res.end('ahihi do ngok')
        })
    },
})
// curl http://localhost:3004/restserver?method=user.login

new Methor(options)

return an instance of http.Server

Options

port

Type: Number Default process.env.PORT

methods

Type: Object Required: true

services

Type: Object

plugins

Type: Array

plugins

Type: Object

static

Type: String Require package: serve-static

created

Type: Function

routes

Type: Array