https://github.com/zeabur/deno-typescript-template
A simple Deno web app using TypeScript deployed on Zeabur.
https://github.com/zeabur/deno-typescript-template
cicd cloud deno deploy deployment javascript typescript zeabur
Last synced: 8 months ago
JSON representation
A simple Deno web app using TypeScript deployed on Zeabur.
- Host: GitHub
- URL: https://github.com/zeabur/deno-typescript-template
- Owner: zeabur
- Created: 2023-02-05T16:03:16.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-05T16:36:01.000Z (over 2 years ago)
- Last Synced: 2025-01-04T19:29:35.649Z (9 months ago)
- Topics: cicd, cloud, deno, deploy, deployment, javascript, typescript, zeabur
- Language: TypeScript
- Homepage: https://deno-typescript.zeabur.app/
- Size: 1000 Bytes
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# deno-typescript-template
- Use `Deno.env.get("PORT")` in your serving function.
```typescript
import { serve } from "https://deno.land/std@0.140.0/http/server.ts";function handler(_req: Request): Response {
return new Response("Hello World!");
}serve(handler, { port: Deno.env.get("PORT") });
```- Create a file `deno.json` and add the starting command.
```json
{
"tasks": {
"start": "deno run --allow-net --allow-env --allow-read main.ts"
}
}```
- To run locally, copy `.env.defaults` to a new file `.env`, and modify `.env` by assigning the port that you would like to run your application.
```shell
cp .env.defaults .env
``````shell
# in .env
PORT=
```