|
|
@ -9,6 +9,7 @@ import publishRoute from "./routes/publish.js"; |
|
|
import {ViewSync} from "./inc/view-sync.js"; |
|
|
import {ViewSync} from "./inc/view-sync.js"; |
|
|
import {previewFiles, staticFiles} from "./routes/static-files.js"; |
|
|
import {previewFiles, staticFiles} from "./routes/static-files.js"; |
|
|
import {setupWatcher} from "./inc/changes-watcher.js"; |
|
|
import {setupWatcher} from "./inc/changes-watcher.js"; |
|
|
|
|
|
import {setHeaders} from "./inc/headers-middleware.js"; |
|
|
|
|
|
|
|
|
const {expressApp, httpServer} = init(); |
|
|
const {expressApp, httpServer} = init(); |
|
|
|
|
|
|
|
|
@ -21,8 +22,10 @@ httpServer.listen(PORT, '0.0.0.0', () => { |
|
|
console.log(`Server app listening on port ${PORT}`) |
|
|
console.log(`Server app listening on port ${PORT}`) |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
// Setup Gulp
|
|
|
// Middleware
|
|
|
|
|
|
expressApp.use(setHeaders); |
|
|
|
|
|
|
|
|
|
|
|
// Routes
|
|
|
expressApp.get('/', index); |
|
|
expressApp.get('/', index); |
|
|
expressApp.get('/data', dataRoute); |
|
|
expressApp.get('/data', dataRoute); |
|
|
expressApp.get('/view/:baseView', baseView); |
|
|
expressApp.get('/view/:baseView', baseView); |
|
|
@ -30,3 +33,4 @@ expressApp.get('/design/:project/:blockName/*', previewFiles); |
|
|
expressApp.get('/block/:project/:blockName/*', staticFiles); |
|
|
expressApp.get('/block/:project/:blockName/*', staticFiles); |
|
|
expressApp.post('/sync', syncRoute); |
|
|
expressApp.post('/sync', syncRoute); |
|
|
expressApp.get('/publish', publishRoute); |
|
|
expressApp.get('/publish', publishRoute); |
|
|
|
|
|
|
|
|
|