annotate src/luan/modules/http/test.luan @ 1218:a50803fde972

http/tools cleanup
author Franklin Schmidt <fschmidt@gmail.com>
date Tue, 20 Mar 2018 16:24:59 -0600
parents 1a68fc55a80c
children 7fc83fd2a39a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
693
ca169567ce07 module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents: 508
diff changeset
1 local Luan = require "luan:Luan.luan"
ca169567ce07 module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents: 508
diff changeset
2 local Io = require "luan:Io.luan"
ca169567ce07 module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents: 508
diff changeset
3 local Server = require "luan:http/Server.luan"
1218
a50803fde972 http/tools cleanup
Franklin Schmidt <fschmidt@gmail.com>
parents: 775
diff changeset
4 local Logging = require "luan:logging/Logging.luan"
a50803fde972 http/tools cleanup
Franklin Schmidt <fschmidt@gmail.com>
parents: 775
diff changeset
5
450
4b8281c5c5af add web/test
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
6
4b8281c5c5af add web/test
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
7 if #{...} ~= 2 then
1218
a50803fde972 http/tools cleanup
Franklin Schmidt <fschmidt@gmail.com>
parents: 775
diff changeset
8 Io.stderr.write "usage: luan luan:http/serve dir test-URI\n"
450
4b8281c5c5af add web/test
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
9 return
4b8281c5c5af add web/test
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
10 end
4b8281c5c5af add web/test
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
11
4b8281c5c5af add web/test
Franklin Schmidt <fschmidt@gmail.com>
parents:
diff changeset
12 local dir, test = ...
1218
a50803fde972 http/tools cleanup
Franklin Schmidt <fschmidt@gmail.com>
parents: 775
diff changeset
13
a50803fde972 http/tools cleanup
Franklin Schmidt <fschmidt@gmail.com>
parents: 775
diff changeset
14 Logging.init()
a50803fde972 http/tools cleanup
Franklin Schmidt <fschmidt@gmail.com>
parents: 775
diff changeset
15 Server.init_dir(dir)
693
ca169567ce07 module URIs must now include ".luan"
Franklin Schmidt <fschmidt@gmail.com>
parents: 508
diff changeset
16 Luan.do_file(test)