Building APIs is one of my favourite things to build when it comes to programming.
Let's create one using deno!
For this tutorial we are going to be using fast, a minimalistic library which allows us to easily create fast APIs.
Let's see how it works:
- Import the library
import fast from "https://deno.land/x/fast/mod.ts";
- Instantiate fast as a constant
const app = fast();
- Make a simple "Hello, World!" message appear in the
/
route
app.get("/", () => "Hello, World!");
- Serve the app
await app.serve()
And that's it!
As simple as that, you created your own custom API using deno!
For more use cases and examples you can check out this link, in which you will find files containing examples.
Thanks for reading!
Top comments (0)