Hello world via deno deploy, with JWT authorization enabled!
deno run -A main.ts
- deploy to Deno Deploy by
deployctl
deployctl deploy -p YOUR_DENO_PROJECT_NAME
- Promote latest deployment to production on Deno Dashboard
# Unauthorized
$ curl https://${YOUR_DEPLOYMENT_DOMAIN}/
Unauthorized
# Auth to get token
$ curl -X POST -H "Content-Type: application/json" -d '{"username":YOUR_USERNAME,"password":YOUR_PASSWORD}' https://${YOUR_DEPLOYMENT_DOMAIN}/auth/
{"access_token":YOUR_TOKEN}
# Get with token
$ curl -H "Authorization: Bearer YOUR_TOKEN" https://deno-hello-1.deno.dev/
Hello world!