mirror of https://github.com/nocodb/nocodb
Pranav C
2 years ago
5 changed files with 125 additions and 0 deletions
@ -0,0 +1,28 @@
|
||||
import axios from 'axios' |
||||
import cors from 'cors'; |
||||
import express from 'express'; |
||||
import Noco from '../lib/Noco'; |
||||
import { User } from '../models' |
||||
import nocobuild from '../nocobuild' |
||||
|
||||
const server = express(); |
||||
server.enable('trust proxy'); |
||||
server.disable('etag'); |
||||
server.disable('x-powered-by'); |
||||
server.use( |
||||
cors({ |
||||
exposedHeaders: 'xc-db-response', |
||||
}) |
||||
); |
||||
|
||||
server.set('view engine', 'ejs'); |
||||
|
||||
process.env[`DEBUG`] = 'xc*'; |
||||
|
||||
|
||||
(async () => { |
||||
await nocobuild(server); |
||||
const httpServer = server.listen(process.env.PORT || 8080, async () => { |
||||
console.log('Server started') |
||||
}); |
||||
})().catch((e) => console.log(e)); |
@ -0,0 +1,34 @@
|
||||
import cors from 'cors'; |
||||
import express from 'express'; |
||||
import nocobuild from '../nocobuild' |
||||
|
||||
const server = express(); |
||||
server.enable('trust proxy'); |
||||
server.disable('etag'); |
||||
server.disable('x-powered-by'); |
||||
server.use( |
||||
cors({ |
||||
exposedHeaders: 'xc-db-response', |
||||
}) |
||||
); |
||||
|
||||
server.set('view engine', 'ejs'); |
||||
|
||||
const date = new Date(); |
||||
const metaDb = `meta_v2_${date.getFullYear()}_${(date.getMonth() + 1) |
||||
.toString() |
||||
.padStart(2, '0')}_${date.getDate().toString().padStart(2, '0')}`;
|
||||
process.env[`NC_DB`] = `mysql2://localhost:3306?u=root&p=password&d=${metaDb}`; |
||||
// process.env[`NC_DB`] = `pg:/2/localhost:3306?u=root&p=password&d=mar_24`;
|
||||
// process.env[`NC_DB`] = `pg://localhost:5432?u=postgres&p=password&d=abcde`;
|
||||
// process.env[`NC_TRY`] = 'true';
|
||||
// process.env[`NC_DASHBOARD_URL`] = '/test';
|
||||
|
||||
// process.env[`DEBUG`] = 'xc*';
|
||||
|
||||
(async () => { |
||||
await nocobuild(server); |
||||
const httpServer = server.listen(process.env.PORT || 8080, async () => { |
||||
console.log('Server started') |
||||
}); |
||||
})().catch((e) => console.log(e)); |
@ -0,0 +1,34 @@
|
||||
import cors from 'cors'; |
||||
import express from 'express'; |
||||
import nocobuild from '../nocobuild' |
||||
|
||||
const server = express(); |
||||
server.enable('trust proxy'); |
||||
server.disable('etag'); |
||||
server.disable('x-powered-by'); |
||||
server.use( |
||||
cors({ |
||||
exposedHeaders: 'xc-db-response', |
||||
}) |
||||
); |
||||
|
||||
server.set('view engine', 'ejs'); |
||||
|
||||
const date = new Date(); |
||||
const metaDb = `meta_v2_${date.getFullYear()}_${(date.getMonth() + 1) |
||||
.toString() |
||||
.padStart(2, '0')}_${date.getDate().toString().padStart(2, '0')}`;
|
||||
// process.env[`NC_DB`] = `mysql2://localhost:3306?u=root&p=password&d=${metaDb}`;
|
||||
// process.env[`NC_DB`] = `pg:/2/localhost:3306?u=root&p=password&d=mar_24`;
|
||||
process.env[`NC_DB`] = `pg://localhost:5432?u=postgres&p=password&d=${metaDb}`; |
||||
// process.env[`NC_TRY`] = 'true';
|
||||
// process.env[`NC_DASHBOARD_URL`] = '/test';
|
||||
|
||||
// process.env[`DEBUG`] = 'xc*';
|
||||
|
||||
(async () => { |
||||
await nocobuild(server); |
||||
const httpServer = server.listen(process.env.PORT || 8080, async () => { |
||||
console.log('Server started') |
||||
}); |
||||
})().catch((e) => console.log(e)); |
@ -0,0 +1,27 @@
|
||||
import cors from 'cors'; |
||||
import express from 'express'; |
||||
import nocobuild from '../nocobuild' |
||||
|
||||
const server = express(); |
||||
server.enable('trust proxy'); |
||||
server.disable('etag'); |
||||
server.disable('x-powered-by'); |
||||
server.use( |
||||
cors({ |
||||
exposedHeaders: 'xc-db-response', |
||||
}) |
||||
); |
||||
|
||||
server.set('view engine', 'ejs'); |
||||
process.env[ |
||||
`NC_DB` |
||||
] = `pg://localhost:5432?u=postgres&p=password&d=meta_v2_2022_06_13`; |
||||
|
||||
//process.env[`DEBUG`] = 'xc*';
|
||||
|
||||
(async () => { |
||||
await nocobuild(server); |
||||
const httpServer = server.listen(process.env.PORT || 8080, async () => { |
||||
console.log('Server started') |
||||
}); |
||||
})().catch((e) => console.log(e)); |
Loading…
Reference in new issue