author | Mahlon E. Smith <mahlon@martini.nu> |
Wed, 27 Oct 2021 13:57:16 -0700 | |
changeset 6 | d49437ff8f2f |
parent 4 | ffb8b9920057 |
permissions | -rw-r--r-- |
0 | 1 |
|
4
ffb8b9920057
Re-arrange for use with nimble, updates for nim 0.19.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
2 |
import src/mongrel2 |
0 | 3 |
|
4
ffb8b9920057
Re-arrange for use with nimble, updates for nim 0.19.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
4 |
let handler = newM2Handler( "mlist", "tcp://127.0.0.1:9019", "tcp://127.0.0.1:9018" ) |
0 | 5 |
|
4
ffb8b9920057
Re-arrange for use with nimble, updates for nim 0.19.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
6 |
proc woo( request: M2Request ): M2Response = |
0 | 7 |
var response = request.response |
8 |
||
4
ffb8b9920057
Re-arrange for use with nimble, updates for nim 0.19.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
9 |
response[ "Content-Type" ] = "text/plain" |
ffb8b9920057
Re-arrange for use with nimble, updates for nim 0.19.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
10 |
response.body = "Hi there." |
ffb8b9920057
Re-arrange for use with nimble, updates for nim 0.19.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
11 |
response.status = HTTP_OK |
0 | 12 |
return response |
13 |
||
4
ffb8b9920057
Re-arrange for use with nimble, updates for nim 0.19.
Mahlon E. Smith <mahlon@martini.nu>
parents:
0
diff
changeset
|
14 |
# handler.action = woo |
0 | 15 |
handler.run |
16 |