0

I currently have a dev-setup with node-dev and iIrecently integrated tsoa into the setup to generate a swagger file and the express-routes for my app.

I already added all the necessary steps to generate my routes but right now its a manual process inside the dev-setup because I cant execute the needed npm-task on every restart of the application through node-dev.

So my question is, if its possible to start this task on every restart initiated by node-dev?

I hope someone can help me, and thanks in advance.

zero323
  • 322,348
  • 103
  • 959
  • 935
Eik W.
  • 51
  • 1
  • 5
  • What is your script to start your dev server, and what is the task that you want to run? – Ghostrydr Apr 13 '18 at 18:09
  • I start my dev-server with "node-dev -r tsc/register app.ts" and i want to execute "tsoa routes" for every app-restart initiated by node-dev. – Eik W. Apr 13 '18 at 18:22

1 Answers1

0

In your package.json add the following entry to scripts

"profit": "tsoa routes && node-dev -r tsc/register app.ts"

Then run it with

npm run profit

You can change profit to whatever you want

Ghostrydr
  • 752
  • 5
  • 14
  • Thats not what i wanted. This would execute the first command one time but i need it to be executed everytime node-dev restarts the application(so everytime a file inside the project changes). Thx for your effort nonetheless – Eik W. Apr 13 '18 at 21:05