npm install volcano-express-cli -g
To create all the files and import all the dependencies needed for a new project, simply use the init command from the CLI :
volcano --init
Your project will then have the following structure :
├── node_modules ├── src │ ├── controllers │ │ ├── demo.controller.ts │ ├── middlewares │ │ ├── demo.middleware.ts │ ├── services │ │ ├── demo.service.ts │ │ ├── dummy-demo.service.ts │ ├── main.ts ├── package.json ├── tsconfig.json
To start the server, use the npm start command.
By default, the server starts at port 3000.
npm start
If the server starts with no error, it outputs a success message in the console :
Server started at port 3000
Once you have built and started the server, you should be able to test it with an http request :
GET/ http://localhost:3000/demo
You should receive a 200 OK response with the following content if everything is working properly :
"Demo"
- init
Creates all the files and import all the dependencies needed for a new project in given folder.
volcano --init
Visit the npm page for Volcano-express for the official documentation.