Boilerplate Deno stuff

This commit is contained in:
Alex Gleason 2023-03-04 19:55:28 -06:00
commit d855c05fac
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
7 changed files with 56 additions and 0 deletions

1
.tool-versions Normal file
View File

@ -0,0 +1 @@
deno 1.31.1

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"denoland.vscode-deno"
]
}

4
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,4 @@
{
"deno.enable": true,
"path-intellisense.extensionOnImport": true
}

32
deno.json Normal file
View File

@ -0,0 +1,32 @@
{
"lock": false,
"tasks": {
"dev": "deno run --allow-read --allow-env --allow-net --watch src/server.ts",
"test": "deno test"
},
"imports": {
"@/": "./src/"
},
"lint": {
"files": {
"include": ["src/"]
},
"rules": {
"tags": ["recommended"],
"exclude": ["no-explicit-any"]
}
},
"fmt": {
"files": {
"include": ["src/"]
},
"options": {
"useTabs": false,
"lineWidth": 120,
"indentWidth": 2,
"semiColons": true,
"singleQuote": true,
"proseWrap": "preserve"
}
}
}

7
src/app.ts Normal file
View File

@ -0,0 +1,7 @@
import { Hono } from '@/deps.ts';
const app = new Hono();
app.get('/', (c) => c.text('Hono!'));
export default app;

1
src/deps.ts Normal file
View File

@ -0,0 +1 @@
export { Hono } from 'https://deno.land/x/hono@v3.0.2/mod.ts';

6
src/server.ts Normal file
View File

@ -0,0 +1,6 @@
import 'https://deno.land/std@0.177.0/dotenv/load.ts';
import { serve } from 'https://deno.land/std@0.177.0/http/server.ts';
import app from './app.ts';
serve(app.fetch);