Skip to content

Commit

Permalink
Merge pull request #4 from pulsate-dev/feat/add-code-of-conduct-endpoint
Browse files Browse the repository at this point in the history
feat: add /rules and /rules-ja endpoint
  • Loading branch information
m1sk9 authored Feb 14, 2024
2 parents 30e97a9 + 3a8e76d commit 9be378e
Show file tree
Hide file tree
Showing 4 changed files with 111 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ with [Deno Deploy](https://deno.com/deploy).
| `/x` | Pulsate X |
| `/youtube` | Pulsate YouTube |
| `/community` | Pulsate Community (GitHub Org Discussion) |
| `/rules` | Pulsate Code of Conduct |
| `/rules-ja` | Pulsate Code of Conduct (Japanese) |

- When redirecting, a status code of
[`302`](https://developer.mozilla.org/ja/docs/Web/HTTP/Status/302) is returned
Expand Down
4 changes: 2 additions & 2 deletions deno.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"semiColons": true
},
"imports": {
"hono/mod": "https://deno.land/x/hono@v3.7.6/mod.ts",
"hono/middleware": "https://deno.land/x/hono@v3.7.6/middleware.ts"
"hono/mod": "https://deno.land/x/hono@v4.0.2/mod.ts",
"hono/middleware": "https://deno.land/x/hono@v4.0.2/middleware.ts"
}
}
91 changes: 90 additions & 1 deletion deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 17 additions & 1 deletion main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { logger, poweredBy } from 'hono/middleware';
const app = new Hono();

app.use('*', logger(), poweredBy());
// todo: faviconを提供する
// TODO: add favicon
// app.all('/favicon.ico', serveStatic('./public/favicon.ico'));

app.get('/', (c) => {
Expand All @@ -31,4 +31,20 @@ app.get('/community', (c) => {
return c.redirect('https://github.com/orgs/pulsate-dev/discussions', 302);
});

// TODO: replace pulsate.dev/code-of-conduct
app.get('/rules', (c) => {
return c.redirect(
'https://github.com/pulsate-dev/.github/blob/main/CODE_OF_CONDUCT.md',
302,
);
});

// TODO: replace pulsate.dev/code-of-conduct-ja
app.get('/rules-ja', (c) => {
return c.redirect(
'https://github.com/pulsate-dev/.github/blob/main/CODE_OF_CONDUCT_JA.md',
302,
);
});

Deno.serve(app.fetch);

0 comments on commit 9be378e

Please sign in to comment.