Create new route
Note: If your application is still running, press CTRL+C to stop it before calling the command
Create route with name `users`
nodpi r users
Answer the prompts as follows:
? Create route with CRUD function? (Use arrow keys)
❯ Yes
No
Users route will be created with following folder structure

Copy paste following route in your main server file in api routes block
app.use('/api/users', require('./users/users.controller'));
You can also create a route by providing folder name as follows
nodpi r user user_api

Last updated
Was this helpful?