DEV Community

Discussion on: Overview of Deno JS - Installation and Building an API

Collapse
 
mikenikles profile image
Mike

That's a great intro to Deno, Sunil!

One thing to keep in mind when it comes to Deno's permissions, is that the following is not ideal:

deno run --allow-net --allow-read --allow-write ./index.js

This allows the Deno application to send requests to any URL, read any file and write any file. In your case, what you want to be secure is the following:

deno run --allow-net=:5000 --allow-read=./data/todos.json --allow-write=./data/todos.json ./index.js

I opened a PR for your repo as well.

Collapse
 
sunilaleti profile image
Sunil Aleti

Hey Mike,
Yes whatever you are saying is true, the main aim of DENO is make more secure. I seriously forgot about setting values to the flags.
Kudos to you and Thanks a lot man