anthrax
v2.2.3
Published
<img src="https://raw.githubusercontent.com/Jobayerdev/Anthrax.js/master/docs/1.png" alt="Anthrax.JS"/>
Maintainers
Readme
Anthrax, or AnthraxJS, is an easy and open-source framework written using Node.js. Anthrax allows for rapid prototyping code. Motivated by ExpressJS.
Installation
$ npx create-anthrax-app my-app
$ cd my-app
$ npm startHello Anthrax
import { AnthraxFactory, Methods } from "anthrax"
class AuthController {
routes = [
{
path: "/login",
method: Methods.GET,
callBack: this.login,
},
{
path: "/register",
method: Methods.GET,
callBack: this.register,
},
]
async login(req: any, res: any) {
return res.json(String(res))
}
async register(req: any, res: any) {
return res.send("Hello Auth register")
}
}
async function bootstrap() {
const app: AnthraxFactory = new AnthraxFactory({
controllers: [AuthController],
})
app.listen(4000, () => {
console.log(`Server is running on port ${4000}`)
})
}
bootstrap()