An open API service indexing awesome lists of open source software.

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.

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=
```