Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tmyt/simple-webapi
https://github.com/tmyt/simple-webapi
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/tmyt/simple-webapi
- Owner: tmyt
- Created: 2015-12-14T01:51:42.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-13T04:58:47.000Z (almost 9 years ago)
- Last Synced: 2024-03-24T10:43:12.985Z (9 months ago)
- Language: JavaScript
- Size: 6.84 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# simple webapi
simple express wrapper.
## brief
this module provides simply method for implements web api.
## usage
write the code in your script.
```javascript
require('simple-webapi')(3000);
```and add your webapi in api directory.
```
exports.get = function(req, res){
res.send('hello world');
}
```## api
```javascript
// listen port 3000, api loads from /api
var app = require('simple-webapi')(3000);// listen port 3000, api loads from /some/dir
var app = require('simple-webapi')('/some/dir', 3000);// api loads from /api, but not listen.
var router = require('simple-webapi')();// api laods from /some/dir, but not listen.
var router = require('simple-webapi')('/some/dir');
```