3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

DenoAdvent Calendar 2022

Day 23

【Deno Deploy Pro】ワイルドカードサブドメインを使う【Wildcard subdomains】

Last updated at Posted at 2022-12-17

好きな文字を入れて試してみてください
https://好きな文字💩.github.day

ワイルドカードサブドメインで好きなサブドメインを作れます

main.ts
import { serve } from "https://deno.land/std@0.155.0/http/server.ts";
import punycode from "https://deno.land/x/punycode/punycode.js";

serve((req: Request) => new Response('Hello ' + punycode.toUnicode(req.url.split(/\/|\./g)[2])))

設定ページから*.example.comのようにドメインを設定できます。
image.png

Googleドメインなら以下のように設定します。

image.png

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?