0.0.0-dev.2 • Published 2 years ago
webcs v0.0.0-dev.2
Web compile service
Express route that exposes an end-point for serving source files to the browser
in development. Files are compiled by webpack, but they don't need to be
statically declared in webpack.config.js. All source files can be served on
demand.
Installation
npm i webcsUsage
import path from "path";
import express from "express";
import expressWs from "express-ws";
import { makeCsRoute } from "webcs";
// make the middleware
const { webcsRoute } = makeCsRoute({
compileServiceRoot: __dirname,
webRootUrl: "http://localhost:3000",
webcsMountPath: "webcs",
staticWebFolder: "probably just for javi",
});
// make the express app
const app = express();
expressWs(app);
app.use("webcs", webcsRoute());
app.listen(3000);
// now a file `hello.ts` is servered ready for the browser at:
// http://localhost:3000/webcs/hello.tsKnown issues
Related work
License
MIT
0.0.0-dev.2
2 years ago