/**
 * Minified by jsDelivr using Terser v5.37.0.
 * Original file: /npm/lasso-node@0.1.13/lasso.js
 *
 * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files
 */
#!/usr/bin/env node
var connect=require("connect"),http=require("http"),path=require("path"),url=require("url"),options=require("./src/options"),handlers=require("./src/handlers"),routes=require("./src/routes"),phantomjs=require("./src/phantomjsWrapper");function run(e){console.assert(e.page,"missing page filename"),e.page=path.resolve(process.cwd(),e.page),e.basedir=path.dirname(e.page),e.timeout=e.timout||3,e.port=e.port||8888,handlers.init({basedir:e.basedir}),e.page=path.basename(e.page);var r=connect().use(connect.favicon()).use(connect.logger("dev")).use((function(r,n){var o=url.parse(r.url).pathname;console.log("serving url",r.url,"pathname",o),"/"===o&&(o=e.page),function(e,r,n){var o=routes.find(e);if(!o)throw new Error("handler not defined for "+e);console.log("matched pattern for",e,o.regex),console.assert("function"==typeof o.handler,"could not find handler function for",e),o.handler(e,r,n)}(o,n,e)}));console.assert(e.port>100,"invalid port",e.port),http.createServer(r).listen(e.port),console.log("server has started at port",e.port),!module.parent&&e.serve||phantomjs.run(e)}module.parent||run(options.run()),exports.run=run;
//# sourceMappingURL=/sm/2e2d198c97f855e86e2e0b52e00347819d20145278d528b42eb025ba85d9b2d1.map