mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
replace unmaintained static-server with serve
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/* eslint-disable no-console */
|
||||
const http = require('http');
|
||||
const chalk = require('chalk');
|
||||
const gaze = require('gaze');
|
||||
const StaticServer = require('static-server');
|
||||
const serve = require('serve-handler');
|
||||
|
||||
const buildCSS = require('./build_css.js');
|
||||
|
||||
@@ -10,7 +10,13 @@ gaze(['css/**/*.css'], (err, watcher) => {
|
||||
watcher.on('all', () => buildCSS());
|
||||
});
|
||||
|
||||
const server = new StaticServer({ rootPath: process.cwd(), port: 8080, followSymlink: true });
|
||||
server.start(() => {
|
||||
const server = http.createServer((request, response) => {
|
||||
return serve(request, response, {
|
||||
symlinks: true
|
||||
});
|
||||
});
|
||||
|
||||
server.listen(8080, () => {
|
||||
/* eslint-disable no-console */
|
||||
console.log(chalk.yellow(`Listening on ${server.port}`));
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user