7

Most of the documentation for a node application on azure app service is around running using iisnode module handler which uses app.js or server.js like files.

What if we want to run the same application which we are developing all along using typescript and running using ts-node?

Possibly one option is to compile typescript files into javascript files, but that will overhead the files created, which I don't want.

Nexus23
  • 6,195
  • 9
  • 50
  • 67
  • I would love a solution to this. Yet another limitation of Azure. I wish my company used AWS. – SSH This Dec 16 '19 at 18:41
  • 1
    doesn't look like this is still an issue in 2020, I was able to add `"start": "ts-node server.ts"` and the app deployed and started correctly on Azure. If the app doesn't start it is most likely related to some other problem, enable detailed logs for your app and then check what's wrong. – Yuriy Kravets Oct 04 '20 at 20:44

1 Answers1

-3

What if we want to run the same application which we are developing all along using typescript and running using ts-node?

Don't run production code using ts-node. Transpile to .js and run js files.

basarat
  • 261,912
  • 58
  • 460
  • 511
  • 1
    basarat any good reason? As I understand ts-node compiles typescript files in-memory to js anyway, so what is the catch? – Nexus23 Nov 02 '17 at 23:25
  • `I understand ts-node compiles typescript files in-memory to js anyway` Exactly. Save a bunch of money – basarat Nov 02 '17 at 23:47
  • 1
    From saving money if you mean saving memory, then in my scenario if crating files in memory isn't a huge issue then in theory the compiled javascript is same whether we run ts or js files. In that case is there anyway to run using ts-node? – Nexus23 Nov 03 '17 at 11:08
  • @basarat I don't get that reasoning either, how much ram would a mid sized project take? 100kb? I think anyone can afford that nowadays? – kentor May 02 '18 at 22:04