DEV Community

Discussion on: Simple REST API with Deno

Collapse
 
jlomaka profile image
Jlomaka

any, really ? Why then do you use TS, it would be better to write to JS right away, since there is no minute to go in and read which interface to use in request and response. For those who are also confused by this, here are the interface to import for these parameters:

import {Request, Response} from "https://deno.land/x/oak/mod.ts";
Enter fullscreen mode Exit fullscreen mode

Typing was not invented to simply ignore it, it was created to exclude a very large number of bugs at the time of writing before writing tests.

Collapse
 
am77 profile image
Mohamed Amine Griche

I totally agree with you and I am sorry for the bad practices in the code.
This was not supposed to be full fledged, secure, scalable app, it is just a simple demonstration on how you can create a simple deno REST, as simple as that.