mirror of
https://gitlab.silvrtree.co.uk/martind2000/nci.git
synced 2025-02-10 18:09:15 +00:00
share workspace files as static
This commit is contained in:
parent
da5f215629
commit
d68d679210
@ -40,7 +40,7 @@ content
|
||||
## Feature requests
|
||||
|
||||
* should write at the end of build console out that build is done (or error)
|
||||
* share workspace files at static
|
||||
* ~~share workspace files at static~~
|
||||
* "clear workspace" button
|
||||
* show more builds button (or infinity scroll) on start page
|
||||
* hide console output by default (when go on completed build page you scroll
|
||||
|
9
app.js
9
app.js
@ -19,13 +19,18 @@ var app = new EventEmitter(),
|
||||
httpApi;
|
||||
|
||||
var staticPath = path.join(__dirname, 'static'),
|
||||
staticServer = new nodeStatic.Server(staticPath);
|
||||
staticServer = new nodeStatic.Server(staticPath),
|
||||
staticDataServer;
|
||||
|
||||
var server = http.createServer(function(req, res) {
|
||||
if (req.url.indexOf('/api/') === 0) {
|
||||
return httpApi(req, res);
|
||||
}
|
||||
|
||||
if (new RegExp('^/projects/(\\w|-)+/workspace').test(req.url)) {
|
||||
return staticDataServer.serve(req, res);
|
||||
}
|
||||
|
||||
if (req.url.indexOf('/data.io.js') === -1) {
|
||||
if (/(js|css|fonts)/.test(req.url)) {
|
||||
staticServer.serve(req, res);
|
||||
@ -143,6 +148,8 @@ Steppy(
|
||||
|
||||
// path to root dir (with projects, builds etc)
|
||||
app.config.paths.data = path.join(process.cwd(), 'data');
|
||||
staticDataServer = new nodeStatic.Server(app.config.paths.data);
|
||||
|
||||
app.config.paths.projects = path.join(app.config.paths.data, 'projects');
|
||||
app.config.paths.db = path.join(app.config.paths.data, 'db');
|
||||
app.config.paths.preload = path.join(app.config.paths.data, 'preload.json');
|
||||
|
Loading…
Reference in New Issue
Block a user