Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

JavaScript/JSON objects to REST API in minutes.

License

NotificationsYou must be signed in to change notification settings

soygul/js-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Creates a REST API server from given JavaScript/JSON objects.UsesKoa for the REST API.Extendable with custom routes and middleware.

Quickstart

Install the package in your project directory:

npm install js-api

Start js-api server with some data:

varjsapi=require('js-api');vardata={posts:[{id:'p1',title:'first post',body:'lorem ipsum'}]};jsapi.start(data,3000);

Now browse tohttp://localhost:3000/posts and you will see the posts in JSON format.

Custom Routes and Middleware

Seeexample.js for a complete example with custom middleware and custom route definitions for resources.

You can download the entire repo and start the example directly with:

npm installnpm start

And browse tohttp://localhost:3000/posts to see the contents of the example.

License

MIT

About

JavaScript/JSON objects to REST API in minutes.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp