I won’t be talking about what is deno here, rather I will explain the code to create a simple local server. To learn more about deno follow their official page.

Github repo on deno-project

For windows run the following command from your PowerShell ISE

iwr https://deno.land/x/install/install.ps1 -useb | iex

For other platforms, please follow this link here

To test if deno has installed successfully, run the deno in the console.

You should see something like this.

Now we’re ready to write code.

This is a simple code which printsHello World in the console.

To run this, run the following command

deno run helloWorld.ts

The above code creates a server at localhost:8000 for us.

Running the following command will give an error:

deno run server.ts

As we can see the logs, it's throwing an error saying we don’t have access to .

In this case, we have to explicitly grant permission to access the local network.

deno run --allow-net= server.ts

Now when we go to localhost:8000 in the browser, we will be able to see hello world being printed there.

We have successfully created our first server with DENO.

I hope you found this article useful. I would love to hear your thoughts. 😇

Thanks for reading. 😊

Cheers! 😃

If you find this article useful, you can show your appreciation by clicking on the clap button. As the saying goes, ‘When we give cheerfully and accept gratefully, everyone is blessed’.

I write articles on JavaScript, electron, and react. Opted for curators for better reach, not money. Open link in incognito to read for free (or contact me)