Sample code to understand Deno
I hope you have install deno on your system. If not follow install guide on https://deno.land/
- I have made calc.ts file inside libs directory and imported into index.ts.
- You can also upload calc.ts on remote server and add server path to index.ts
Clone repository and run
$ cd deno-demo
$ deno run --allow-net index.ts
--allow-net flag allows file to run on local network or else you will encounter following error
error: Uncaught PermissionDenied: network access to "0.0.0.0:<PORT>", run again with the --allow-net flag