Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add welcome screen on /
Browse files Browse the repository at this point in the history
Enter-tainer committed Sep 28, 2024
1 parent c1c0ed5 commit d9483c5
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion cloudflare-workers/src/index.ts
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
* Learn more at https://developers.cloudflare.com/workers/
*/

import { AutoRouter, cors, error, IRequest } from 'itty-router';
import { AutoRouter, cors, error, html, IRequest } from 'itty-router';
import {
DeleteCommentIDParam,
GetCommentBody,
@@ -69,6 +69,11 @@ const router = AutoRouter<IRequest, [Env, ExecutionContext]>({
finally: [corsify],
});

router.get('/', async () => {
return html`<h1>OI-Wiki feedback sys backend</h1>
See <a href="https://github.com/OI-wiki/feedback-sys">GitHub</a> for more information.`;
});

router.post('/comment/:path', async (req, env, ctx) => {
const params = req.params as GetCommentBody;

2 changes: 1 addition & 1 deletion cloudflare-workers/wrangler.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#:schema node_modules/wrangler/config-schema.json
name = "feedback-sys-backend"
main = "src/index.ts"
compatibility_date = "2023-05-18"
compatibility_date = "2024-09-23"
compatibility_flags = ["nodejs_compat"]
routes = [
{ pattern = "feedback-sys.mgt.moe", custom_domain = true }

0 comments on commit d9483c5

Please sign in to comment.