Add subdomains git and apps

This commit is contained in:
2025-06-11 14:23:11 -07:00
parent c2dcb5708a
commit 1e33d2770a
3 changed files with 68 additions and 3 deletions

View File

@@ -10,9 +10,7 @@ req = (url) ->
describe "test environment", ->
it "can't connect to the internet", ->
request = http.init "http://example.org"
assert.not_true request\perform!
assert.same request\lastError!, "Couldn't resolve host name"
assert.has_error (-> req "http://example.org"), "Couldn't resolve host name"
describe "http://webdevcat.me", ->
it "permanently redirects to http://miti.sh", ->
@@ -24,21 +22,50 @@ describe "http://webdevcat.me", ->
describe "http://webdevcat.me/git", ->
it "permanently redirects to http://git.miti.sh/ccm/", ->
request = req "http://webdevcat.me/git"
assert.same request\statusCode!, 301
assert.same request\statusMessage!, "Moved Permanently"
assert.same request\header!.Location, "http://git.miti.sh/ccm/"
describe "http://webdevcat.me/git/", ->
it "permanently redirects to http://git.miti.sh", ->
request = req "http://webdevcat.me/git"
assert.same request\statusCode!, 301
assert.same request\statusMessage!, "Moved Permanently"
assert.same request\header!.Location, "http://git.miti.sh/ccm/"
describe "http://webdevcat.me/git/pandoc", ->
it "permanently redirects to http://git.miti.sh/ccm/pandoc", ->
request = req "http://webdevcat.me/git/pandoc"
assert.same request\statusCode!, 301
assert.same request\statusMessage!, "Moved Permanently"
assert.same request\header!.Location, "http://git.miti.sh/ccm/pandoc"
describe "http://git.webdevcat.me", ->
it "permanently redirects to http://git.miti.sh/", ->
request = req "http://git.webdevcat.me"
assert.same request\statusCode!, 301
assert.same request\statusMessage!, "Moved Permanently"
assert.same request\header!.Location, "http://git.miti.sh/"
describe "http://webdevcat.me/apps/btroops", ->
it "permanently redirects to http://apps.miti.sh/btroops", ->
request = req "http://webdevcat.me/apps/btroops"
assert.same request\statusCode!, 301
assert.same request\statusMessage!, "Moved Permanently"
assert.same request\header!.Location, "http://apps.miti.sh/btroops"
describe "http://apps.webdevcat.me", ->
it "permanently redirects to http://apps.miti.sh/", ->
request = req "http://apps.webdevcat.me"
assert.same request\statusCode!, 301
assert.same request\statusMessage!, "Moved Permanently"
assert.same request\header!.Location, "http://apps.miti.sh/"
describe "http://apps.webdevcat.me/btroops", ->
it "permanently redirects to http://apps.miti.sh/btroops", ->
request = req "http://apps.webdevcat.me/btroops"
assert.same request\statusCode!, 301
assert.same request\statusMessage!, "Moved Permanently"
assert.same request\header!.Location, "http://apps.miti.sh/btroops"
describe "http://miti.sh", ->
@@ -76,6 +103,14 @@ describe "http://miti.sh/posts", ->
assert.same request\statusMessage!, "OK"
assert.same request\body!\match("<title>(.*)</title>"), "miti.sh · Posts"
describe "http://git.miti.sh", ->
it "doesn't find it?", ->
request = req "http://git.miti.sh"
require("moon").p request\body!
require("moon").p request\header!
-- assert.same request\statusCode!, 404
-- assert.same request\statusMessage!, "Not Found"
describe "http://apps.miti.sh", ->
it "doesn't find it", ->
request = req "http://apps.miti.sh"