fix(server): some changes

This commit is contained in:
diced 2021-09-03 17:03:47 -07:00
parent 90c72f7ffe
commit cb40559e49
No known key found for this signature in database
GPG key ID: 85AB64C74535D76E
2 changed files with 5 additions and 6 deletions

View file

@ -12,9 +12,9 @@ const prismaRun = require('../scripts/prisma-run');
const readConfig = require('../src/lib/readConfig');
const mimes = require('../scripts/mimes');
const deployDb = require('../scripts/deploy-db');
const { version } = require('../package.json');
Logger.get('server').info('starting zipline server');
Logger.get('server').info(`starting zipline@${version} server`);
const dev = process.env.NODE_ENV === 'development';
@ -42,10 +42,11 @@ function shouldUseYarn() {
Logger.get('database').info('some migrations are not applied, applying them now...');
await deployDb(config);
Logger.get('database').info('finished applying migrations');
} else {
Logger.get('database').info('migrations up to date');
}
process.env.DATABASE_URL = config.core.database_url;
// await stat('./.next');
await mkdir(config.uploader.directory, { recursive: true });
const app = next({
@ -55,6 +56,7 @@ function shouldUseYarn() {
}, config.core.port, config.core.host);
await app.prepare();
await stat('./.next');
const handle = app.getRequestHandler();
const prisma = new PrismaClient();

View file

@ -19,9 +19,6 @@ export interface ConfigUploader {
// The route uploads will be served on
route: string;
// The route embedded routes will be served on
embed_route: string;
// Length of random chars to generate for file names
length: number;