Skip to content

PatrickJS/servie-route

 
 

Repository files navigation

Servie Route

NPM version NPM downloads Build status Test coverage

Simple route middleware for Servie.

Installation

npm install servie-route --save

Usage

import { get, post } from 'servie-route'
import { compose } from 'throwback'

const animals = [
  'rabbit',
  'dog',
  'cat'
]

const app = compose([
  get('/pets', function () {
    return new Response({ body: animals })
  }),
  get('/pets/:id', function (req) {
    return new Response({ body: animals[Number(req.params[0])] })
  })
])

TypeScript

This project is written using TypeScript and publishes the definitions directly to NPM.

License

Apache 2.0

About

Simple route middleware for Servie

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 100.0%