app.js 1.1 KB

12345678910111213141516171819202122232425
  1. const express = require("express");
  2. const compression = require("compression");
  3. const app = express();
  4. app.use(compression());
  5. const views = `${__dirname}/views/`;
  6. app.get("/", (req, res)=>res.sendFile(`${views}/index.html`));
  7. app.get("/workbench", (req, res)=>res.sendFile(`${views}/workbench/index.html`));
  8. app.get("/workbench.js", (req, res)=>res.sendFile(`${views}/workbench/workbench.js`));
  9. app.get("/patio-table", (req, res)=>res.sendFile(`${views}/patioTable/patioTable.html`));
  10. app.get("/patio-table.js", (req, res)=>res.sendFile(`${views}/patioTable/patioTable2.js`))
  11. app.get("/three.js", (req, res)=>res.sendFile(`${__dirname}/threejs/three.min.js`));
  12. app.get("/orbit-controls.js", (req, res)=>res.sendFile(`${__dirname}/threejs/orbitControls.min.js`));
  13. app.get("/css-2d-renderer.js", (req, res)=>res.sendFile(`${__dirname}/threejs/CSS2DRenderer.min.js`));
  14. app.get("/image/:img", (req, res)=>res.sendFile(`${views}/image/${req.params.img}`));
  15. app.get("/objects/setup.js", (req, res)=>res.sendFile(`${views}/objects/setup.js`));
  16. app.get("/objects/board.js", (req, res)=>res.sendFile(`${views}/objects/Board.js`));
  17. app.listen(process.env.PORT);