https://github.com/jupegarnica/garn-static
Super simple server for static files that works in deno deploy
https://github.com/jupegarnica/garn-static
deno typescript
Last synced: about 1 month ago
JSON representation
Super simple server for static files that works in deno deploy
- Host: GitHub
- URL: https://github.com/jupegarnica/garn-static
- Owner: jupegarnica
- License: mit
- Created: 2021-10-30T08:36:04.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2021-11-03T09:56:29.000Z (over 4 years ago)
- Last Synced: 2025-02-27T10:10:39.808Z (over 1 year ago)
- Topics: deno, typescript
- Language: TypeScript
- Homepage: https://deno.land/x/static
- Size: 133 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# garn-static
Super simple server for static files that works in deno deploy
## Usage
As code:
```ts
import { serve } from "https://deno.land/x/static/main.ts";
// default serving folder . at port 8080
const server = serve();
// serving folder ./dist at port 1234
const server = serve("./dist", 1234);
// await until completion
await server.promise;
// or to close the server
await server.abort();
```
As installed script:
```bash
deno install --allow-net --allow-read -fn static https://deno.land/x/static/main.ts
static dist 80
# or with default args
static
```
Run remotely
```bash
deno run --allow-net --allow-read https://deno.land/x/static/main.ts dist 8081
```