pegjs/spec/server
David Majda 516023546d Use one var/let/const per variable (for initialized variables)
Use one var/let/const per variable, but only for initialized variables.
Uninitialized variables are still grouped into one var/let/const
declaration as I don't see any value in separating them. This approach
reflects the fact that initialized and uninitialized var/let/const
declarations are really two different things.

See #443.
2016-09-17 15:09:07 +02:00

40 lines
884 B
JavaScript
Executable file

#!/usr/bin/env node
/* eslint-env node */
/* eslint no-console: 0 */
"use strict";
/*
* Small server whose main purpose is to ensure that both the specced code and
* the specs get passed through Babel & Browserify before they are served to the
* browser.
*/
let express = require("express");
let logger = require("morgan");
let glob = require("glob");
let browserify = require("browserify");
let babelify = require("babelify");
let app = express();
app.use(logger("dev"));
app.use(express.static(__dirname));
app.get("/bundle.js", (req, res) => {
let files = glob.sync(__dirname + "/**/*.js", {
ignore: __dirname + "/vendor/**/*"
});
browserify(files)
.transform(babelify, { presets: "es2015", compact: false })
.bundle()
.pipe(res);
});
app.listen(8000, () => {
console.log("Spec server running at http://localhost:8000...");
});