Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brandoncorbin/dead-simple-api
Dead Simple API Starter Kit
https://github.com/brandoncorbin/dead-simple-api
Last synced: 17 days ago
JSON representation
Dead Simple API Starter Kit
- Host: GitHub
- URL: https://github.com/brandoncorbin/dead-simple-api
- Owner: brandoncorbin
- License: mit
- Created: 2015-09-05T17:17:55.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-09-05T20:42:48.000Z (over 9 years ago)
- Last Synced: 2024-11-11T02:16:25.164Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Dead Simple API Starter Kit
A Node/Express4 starter kit that uses the Dead Simple API Engine http://github.com/brandoncorbin/dead-simple-api-engine
## Overview
The Dead Simple API Engine is a Node module that allows you to quickly build a maintainable restful API without all the headaches.## Getting Started
## Installation
````
git clone https://github.com/brandoncorbin/dead-simple-api.git
cd dead-simple-api
npm install
node index.js
````
The visit: http://localhost:3100/v1/test/world### Folder Structure
- **api** Everything is contained within a folder, I recommend "api".
- **routes** Folder for your Versions
- **v1** First Version
- **test** API Module Folder
- **test.js** API Module Entry Point (must always be the name of it's parent folder)In the example above we'd access this test.js by visiting ``localhost:3100/api/v1/test``
#### Example Trigger: test.js
The following will produce ``/api/v1/test/`` and ``/api/v1/test/world``
```
var express = require('express');
var router = express.Router();router.get('/', function (req, res) {
res.json({
message : 'If this message also has a property of "Injected", everything is working just find.'
});
});router.get('/world', function (req, res) {
res.send('The World said "Hello" back!');
});module.exports = router; // Send it to the App
```