Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run Typescript files on Server in background?

I have a NodeJS application which has only typescript files in it, no js files. I want to run in on my server in the background.

How can I archive that?

I tried using the npm package called forever but it only works with js files as it doesn't understand the typescript code.

like image 445
SwiftiSwift Avatar asked Jan 01 '23 15:01

SwiftiSwift


1 Answers

You could use forever in combination with ts-node.

Here is a link to the npm package ts-node

I would suggest using the following command:

forever start -v -c ts-node app.ts

Where -v/--verbose is for turning on the verbose messages from Forever.

And -c is the COMMAND to execute which is default is node

like image 137
Max Avatar answered Jan 03 '23 05:01

Max