about summary refs log tree commit diff stats
path: root/adapter/protocol/about.nim
blob: df5ae64963fc6b4eda5af2a2aceb74c0cc999b61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
when NimMajor >= 2:
  import std/envvars
else:
  import std/os

const chawan = staticRead"res/chawan.html"
const license = staticRead"res/license.html"

template printPage(s: static string) =
  stdout.write("Content-Type: text/html\n\n")
  stdout.write(s)

proc main() =
  case getEnv("MAPPED_URI_PATH")
  of "blank": printPage("")
  of "chawan": printPage(chawan)
  of "license": printPage(license)
  else: stdout.write("Cha-Control: ConnectionError 4 about page not found")

main()