Skip to content

lumosjs/lumos

Repository files navigation

Lumosjs Logo

Fast, minimalist web framework for Node.js.

NPM Version NPM Install Size NPM Downloads

export default function apiRoutes(app) {

  //global prefix is /api/*

 app.get("/",function(req,res)=>{
      res.send("Hello world");
  });

}

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

Installation is done using the

$ npm install -g lumos-cli

Follow our installing guide for more information.

Features

  • Data Validation : Perform input validation in controllers using specified fields and messages.
  • Routing : Easily create routes using controllers, defining APIs and routes for views.
  • Controllers and Services : Separate data handling and business logic, facilitating maintenance and scalability.
  • Middlewares : Apply intermediate logic to routes with custom middlewares.
  • Data Models : Model your data structure using models defined in the 'model' directory.
  • Production Error Logs : Have detailed logs to ease debugging in production.
  • File Upload : Support for individual and multiple file uploads.
  • Authentication and Authorization : Implement authentication and authorization using middlewares and sessions for securely managing user state.
  • CORS Handling : Control which domains can access your API.
  • Rate Limiting : Safeguard your server against DDoS attacks with rate limiting.

Docs & Community

Philosophy

The Lumosjs philosophy is to provide small, robust tooling for HTTP servers, making it a great solution for single page applications, websites, hybrids, or public HTTP APIs.

Lumosjs does not force you to use any specific ORM. you can quickly craft your perfect framework.

Example

//simple upload file

import  upload   from "#utils/uploadFile"

export default function apiRoutes(app){
/*
  upload(folder,fileName).type(extensionRequired).single() or use mult to more files.
*/

app.post("/upload",async (req,res)=>{
  	const singleFileUpload = await upload("user/file", req.body.files.file).type('png',"mp3","pdf").single();
   });
}

Running Tests

To run the test suite, first install the dependencies, then run npm test:

$ npm install mocha chai
$ npm test

Contributing

The Lumosjs project welcomes all constructive contributions. Contributions take many forms, from code for bug fixes and enhancements, to additions and fixes to documentation, additional tests, triaging incoming pull requests and issues, and more, I will soon add typescript to the project, for now I will improve and add some new features!

See the Contributing Guide for more technical details on contributing.

People

The original author of Lumosjs is Vicente Sombo

License

MIT

Releases

No releases published

Packages

No packages published