Good examples here : https://fortjs.info/tutorial/get-started/
Component based MVC web framework for nodejs targeting good code structures & modularity.
- Continues on from the example provided by original author
- Used for letting students extend the minimal REST server and pages starting from a known, working state
- Based on Fort architecture.
- MVC Framework and follows OOPS approach so everything is class and object.
- Provides components - Wall, Shield and Guard. Components help modularize the application.
- No callback, Uses ES6 async/await or promise for executing asychronous code.
- Everything is configurable - you can configure your session store, view engine, websocket etc.
- Dependency Injection.
- Everything can be unit tested, so you can use a TDD approach.
- TypeScript Support - Fully supported for typescript users.
import {Controller, DefaultWorker, textResult } from "fortjs"
export class UserController extends Controller{
@DefaultWorker()
async getUsers(){
return textResult("Hey, I am get users method");
}
}
import { Fort } from "fortjs";
import { UserController } from "./controllers";
// add routes
Fort.routes = [{
controller: UserController,
path: "/user"
}]
// initiate app
Fort.create().then(()=>{
Fort.logger.info(`App is started at location : http://localhost:${Fort.port}`);
})
Check out repo - https://github.com/ujjwalguptaofficial/fortjs-examples
You are very welcome to contribute, please see contributing guidelines - [Contribute].
Support this project by becoming a sponsor. Your logo will show up here with a link to your website. For sponsoring, contact author of this project.
- Absolute route
- Retrieve dependency injection value from anywhere like in service