Allow to test Deno with basic Rest API
Created and maintained by veben
Create a .env file with following content:
DB_NAME=<database name>
DB_HOST_URL=<connection string>
curl -fsSL https://deno.land/x/install/install.sh | sh
~.zshrc
file# For Deno
export DENO_INSTALL="/home/veben/.deno"
export PATH="$DENO_INSTALL/bin:$PATH"
deno -V
deno run --allow-write --allow-read --allow-plugin --allow-net --allow-env --unstable ./main.ts
n
curl -X POST --header "Content-Type: application/json" --data '{
"name": "stegosaurus",
"weight": 6000,
"kingdom": "animalia",
"phylum": "chordata",
"clade": "dinosauria"
}' "http://localhost:5000/api/dinosaur"
curl -X GET "http://localhost:5000/api/dinosaur"
Author: veben
Source Code: https://github.com/veben/deno_rest_api
#deno #nodejs #node #javascript