mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-05 11:18:39 +00:00
Automatically start a development server
This avoids one of the few requirements we have left: you no longer have to start a KaTeX development server, the script will do it for you, using a random port number. To reproduce the old behaviour, explicitely state --katex-port=7936.
This commit is contained in:
12
server.js
12
server.js
@@ -7,7 +7,9 @@ var less = require("less");
|
||||
|
||||
var app = express();
|
||||
|
||||
app.use(express.logger());
|
||||
if (require.main === module) {
|
||||
app.use(express.logger());
|
||||
}
|
||||
|
||||
var serveBrowserified = function(file, standaloneName) {
|
||||
return function(req, res, next) {
|
||||
@@ -69,5 +71,9 @@ app.use(function(err, req, res, next) {
|
||||
res.send(500, err.stack);
|
||||
});
|
||||
|
||||
app.listen(7936);
|
||||
console.log("Serving on http://0.0.0.0:7936/ ...");
|
||||
if (require.main === module) {
|
||||
app.listen(7936);
|
||||
console.log("Serving on http://0.0.0.0:7936/ ...");
|
||||
}
|
||||
|
||||
module.exports = app;
|
||||
|
Reference in New Issue
Block a user