Opinionated, light-weight HTTP container for node.js. It brings a design by contract approach to Web API development.
Makes Web APIs arguably cheaper to write by allowing developers to focus on the business logic instead of non-functional requirements.
$ npm install -g tokio-rest
tokio-rest is supported in node v6+.
Create a NPM module
$ mkdir hello-tokio
$ cd hello-tokio
$ npm init -y
Create an index.js
file
const myProgram = {
$do() {
return 'Hello World!';
}
};
module.exports = function myProgramFactory() {
return myProgram;
}
Save it and, in your project folder, run
$ tokio-rest -m .
Point your browser to http://localhost:8080.
$ tokio-rest -m path_to_your_module
Install a process supervisor, e.g. nodemon
$ npm i -g nodemon
Run with supervisor, e.g. nodemon
$ nodemon -w path_to_your_module tokio-rest -m path_to_your_module
TODO
This project is the result of the collaborative work of
- fernandesh
- mirandal
- bacelarh
- soaresp
- henriquesj
MIT