Browse Source

feat(nocodb): add local.ts

pull/5402/head
Wing-Kam Wong 2 years ago
parent
commit
63c61fe501
  1. 18
      packages/nocodb/src/run/local.ts

18
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));
Loading…
Cancel
Save