The CLI helps to create a Node API application with MongoDB, Fastify and Swagger.
Firstly, install it with:
npm install -g @vixnguyen/naf
Now you can run naf by simply doing:
naf
The Naf CLI makes it easy to create an application that already works, right out of the box. It already follows our best practices.
naf init
- NodeJS
- MongoDB
After a new project initialized, at the root folder of your project, you can generate controllers, routes, schemas and models with a simple command in the table below:
Scaffold | Usage |
---|---|
[Model] | naf model |
[Controller, Route, Schema] | naf controller |
Note that the generating script only support when you run it at the root folder of your project.
npm install
npm start