|
Revision 34, 0.8 kB
(checked in by xammy, 3 years ago)
|
Fixed some bugs due to changes in Tango API
|
| Line | |
|---|
| 1 |
import fcgi.Application; |
|---|
| 2 |
import fcgi.Connection; |
|---|
| 3 |
import fcgi.Request; |
|---|
| 4 |
|
|---|
| 5 |
import tango.io.stream.Format; |
|---|
| 6 |
import tango.text.convert.Layout; |
|---|
| 7 |
|
|---|
| 8 |
class MyApp : FastCGIApplication |
|---|
| 9 |
{ |
|---|
| 10 |
|
|---|
| 11 |
private FormatOutput!(char) stdout; |
|---|
| 12 |
private FormatOutput!(char) stderr; |
|---|
| 13 |
|
|---|
| 14 |
this (int id, FastCGIRequest request) |
|---|
| 15 |
{ |
|---|
| 16 |
auto layout = new Layout!(char) (); |
|---|
| 17 |
|
|---|
| 18 |
stdout = new FormatOutput!(char) (layout, request.stdout); |
|---|
| 19 |
stderr = new FormatOutput!(char) (layout, request.stderr); |
|---|
| 20 |
} |
|---|
| 21 |
|
|---|
| 22 |
int run() |
|---|
| 23 |
{ |
|---|
| 24 |
stdout ("Content-type: text/html\r\n\r\n"); |
|---|
| 25 |
stdout ("Hello world!\n") (); |
|---|
| 26 |
|
|---|
| 27 |
return 0; |
|---|
| 28 |
} |
|---|
| 29 |
} |
|---|
| 30 |
|
|---|
| 31 |
int main(char[][] args) |
|---|
| 32 |
{ |
|---|
| 33 |
// FastCGIConnection connection = new FastCGIConnection (); |
|---|
| 34 |
// return FastCGIApplication.loop!(MyApp) (connection, true, 10); |
|---|
| 35 |
|
|---|
| 36 |
return FastCGIApplication.loop!(MyApp) (null, true, 10); |
|---|
| 37 |
} |
|---|