Skip to content
This repository was archived by the owner on Jan 21, 2019. It is now read-only.

Repository files navigation

Build Status

stackkit-resource-router

A resource router for express. This package will automatically create all the routes for a restful application.

Installation

Using npm

npm install stackkit-resource-router

In nodejs

constexpress=require('express')constapp=express()constrouter=require('stackkit-resource-router')router.use(app)router.resource('/test',require('./testController'))app.listen(3000)

Example controller

exports.index=function(req,res){res.send('test index');};exports.store=function(req,res){res.send('test server');};exports.show=function(req,res){res.send('show test '+req.params.id);};exports.update=function(req,res){res.send('update test '+req.params.id);};exports.destroy=function(req,res){res.send('destroy test '+req.params.id);};

About

Stackkit resource router

Topics

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages