1.0.1 • Published 3 years ago
ripazha v1.0.1
ripazha
A file based routing framework for creating javascript backends.
File Based: ripazha doesn't have explicit api routes, rather the request handler to be loaded is inferred automatically by ripazha based on request's path and request's http verb.
HTTP based: Based on the javascript's default http module.
Installation
npm install ripazha
Usage
- In your project directory create an
index.jsfile, with following content:
const ripazha = require("ripazha");
const PORT = 3000;
const app = new openpress(PORT, () => {
console.log("server running on PORT ", PORT);
});- Create a folder at the same location as index.js, say
/users - Create a file called
user.jsin/users - From
user.jsexport a function calledget, such as:
exports.get = (req, res) => {
res.send("Hello, from ripazha!")
}- Your api is ready. Start your
ripazhaapp withnode index.jsand send aGETrequest to/users/user.