1.0.7 • Published 3 years ago

create-anthrax-app v1.0.7

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

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 start

Hello 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()

Author

Jobayer Hossain

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago