static void Main(string[] args) { var application = new Application(new TupleList<string, CreateRequestHandler, Dictionary<string, object>> { {"/", (app, req, args_) => new MainHandler(app, req, args_), null}}); var http_server = new HTTPServer(application.Call); http_server.listen(8888); IOLoop.instance().start(); }
public void Listen(int port, string address="") { /*Starts an HTTP server for this application on the given port. This is a convenience alias for creating an HTTPServer object and calling its listen method. Keyword arguments not supported by HTTPServer.listen are passed to the HTTPServer constructor. For advanced uses (e.g. preforking), do not use this method; create an HTTPServer and call its bind/start methods directly. Note that after calling this method you still need to call IOLoop.instance().start() to start the server. */ // import is here rather than top level because HTTPServer // is not importable on appengine var server = new HTTPServer(Call); server.listen(port, address); }