Run webserver using hono

This commit is contained in:
Mylloon 2023-09-13 23:39:13 +02:00
parent 93511dbff4
commit 34d1a63ed1
Signed by: Anri
GPG key ID: A82D63DFF8D1317F
3 changed files with 40 additions and 5 deletions

26
package-lock.json generated
View file

@ -9,7 +9,10 @@
"version": "1.0.0", "version": "1.0.0",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"node-ical": "^0.16.1", "@hono/node-server": "^1.1.1",
"@types/node": "^20.6.0",
"hono": "^3.6.0",
"node-ical": "~0.16.1",
"typescript": "~5.2.2" "typescript": "~5.2.2"
}, },
"devDependencies": { "devDependencies": {
@ -83,6 +86,14 @@
"node": "^12.22.0 || ^14.17.0 || >=16.0.0" "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
} }
}, },
"node_modules/@hono/node-server": {
"version": "1.1.1",
"resolved": "https://registry.npmjs.org/@hono/node-server/-/node-server-1.1.1.tgz",
"integrity": "sha512-0ZfrcW8Y+TAGNzKGoDB1iQ7Gv7uGsGDOYlz7nckXcHRpK60Oxuz1ttiFmdHYmI6kGO+/VJ8Iy58LDhoTPqkiow==",
"engines": {
"node": ">=18.0.0"
}
},
"node_modules/@humanwhocodes/config-array": { "node_modules/@humanwhocodes/config-array": {
"version": "0.11.11", "version": "0.11.11",
"resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz",
@ -173,6 +184,11 @@
"integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==", "integrity": "sha512-Hr5Jfhc9eYOQNPYO5WLDq/n4jqijdHNlDXjuAQkkt+mWdQR+XJToOHrsD4cPaMXpn6KO7y2+wM8AZEs8VpBLVA==",
"dev": true "dev": true
}, },
"node_modules/@types/node": {
"version": "20.6.0",
"resolved": "https://registry.npmjs.org/@types/node/-/node-20.6.0.tgz",
"integrity": "sha512-najjVq5KN2vsH2U/xyh2opaSEz6cZMR2SetLIlxlj08nOcmPOemJmUK2o4kUzfLqfrWE0PIrNeE16XhYDd3nqg=="
},
"node_modules/@types/prettier": { "node_modules/@types/prettier": {
"version": "2.7.3", "version": "2.7.3",
"resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.7.3.tgz",
@ -1046,6 +1062,14 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/hono": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/hono/-/hono-3.6.0.tgz",
"integrity": "sha512-snkW8naO1WCrQvpAGE/du30Ek0h71gSM3g4RzzdPIB2LQnl12BEwZYH3s2Kssd6kXGORqHmpoyMBMLWtc9nzKQ==",
"engines": {
"node": ">=16.0.0"
}
},
"node_modules/ignore": { "node_modules/ignore": {
"version": "5.2.4", "version": "5.2.4",
"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz",

View file

@ -20,7 +20,10 @@
"author": "Mylloon", "author": "Mylloon",
"license": "AGPL-3.0-or-later", "license": "AGPL-3.0-or-later",
"dependencies": { "dependencies": {
"node-ical": "^0.16.1", "@hono/node-server": "^1.1.1",
"@types/node": "^20.6.0",
"hono": "^3.6.0",
"node-ical": "~0.16.1",
"typescript": "~5.2.2" "typescript": "~5.2.2"
}, },
"devDependencies": { "devDependencies": {

View file

@ -1,5 +1,13 @@
import * as ical from "node-ical"; import { serve } from "@hono/node-server";
import { Hono } from "hono";
/* import * as ical from "node-ical";
ical.async.parseICS("", (error, data: ical.CalendarResponse) => { ical.async.parseICS("", (_error, data: ical.CalendarResponse) => {
console.log(data); console.log(data);
}); }); */
const app = new Hono();
app.get("/", (c) => c.text("Hello Hono!"));
console.log("Listening to http://127.0.0.1:3000");
serve(app);