1
0
mirror of https://github.com/nextapps-de/flexsearch.git synced 2025-09-30 15:18:57 +02:00
Files
flexsearch/task/server.js
Thomas Wilkerling 9852a70028 ADD v0.7.0 (preview)
2021-06-05 13:37:27 +02:00

57 lines
962 B
JavaScript

#!/usr/bin/env node
var port = process.argv[2];
if(!port){
if(/^win/.test(process.platform)){
port = 80;
}
else{
port = 8080;
}
}
var ws = require('web-servo');
ws.config({
"server": {
"port": port,
"dir": "/",
"exitOnError": false,
"ssl": {
"enabled": false,
"key": "",
"cert": ""
}
},
"page": {
"default": "index.html"
},
"methods": {
"allowed": [
"OPTIONS",
"GET",
"POST",
"HEAD",
"PUT",
"PATCH",
"DELETE"
//"COPY",
//"LINK",
//"UNLINK",
//"TRACE",
//"CONNECT"
]
}
});
//ws.setConfigVar('server.port', port);
ws.silent().start();
console.log("-----------------------------------------------------");
console.log("Hit CTRL-C to stop the server...");