diff --git a/packages/nocodb/src/run/local.ts b/packages/nocodb/src/run/local.ts new file mode 100644 index 0000000000..f06c6845b8 --- /dev/null +++ b/packages/nocodb/src/run/local.ts @@ -0,0 +1,18 @@ +import path from 'path'; +import cors from 'cors'; +import express from 'express'; + +import Noco from '../lib/Noco'; + +const server = express(); +server.enable('trust proxy'); +server.use(cors()); +server.use('/dashboard', express.static(path.join(__dirname, 'nc-gui'))); +server.set('view engine', 'ejs'); + +(async () => { + const httpServer = server.listen(process.env.PORT || 8080, () => { + console.log(`App started successfully.\nVisit -> ${Noco.dashboardUrl}`); + }); + server.use(await Noco.init({}, httpServer, server)); +})().catch((e) => console.log(e));