apply workspace unit scale to dropped loaded STLs

This commit is contained in:
Stewart Allen 2020-12-13 09:55:30 -05:00
commit f10879edda
7 changed files with 39 additions and 18 deletions

9
app.js
View file

@ -22,6 +22,7 @@ const synth = {};
const api = {};
let level;
let setupFn;
let cacheDir;
let startTime;
let lastmod;
@ -73,6 +74,7 @@ function init(mod) {
return vmatch.indexOf(cookie) >= 0;
});
mod.add(handleSetup);
mod.add(handleOptions);
mod.add(fullpath({
"/kiri" : redir("/kiri/", 301),
@ -212,7 +214,8 @@ function initModule(mod, file, dir) {
};
},
redir: redir,
remap: remap
remap: remap,
setup: fn => { setupFn = fn }
},
handler: {
addCORS: addCorsHeaders,
@ -428,6 +431,10 @@ function string2obj(s) {
return JSON.parse(s);
}
function handleSetup(req, res, next) {
if (setupFn) setupFn(req, res, next);
}
function handleVersion(req, res, next) {
if (req.app.path === "/kiri/" && req.url.indexOf(version) < 0) {
if (req.url.indexOf("?") > 0) {