feat(cli): run migrations and app in start command (#284)

* feat: perform pending migrations in start command

* feat: log error when DB connection is refused

* feat: log error when Redis connection is refused

* refactor: fix type errors

* fix: correct server and copy graphql schema

* fix: differentiate migrations by env

* chore: remove dev executable

* chore: fix typo in default postgresUsername

* fix: copy json files into dist folder

* chore(cli): add dev script

* chore: pull non-dev logs to info level

* feat(cli): run app in start command

* fix(backend): remove default count in Connection

* fix(cli): remove .eslintrc usage in lint script

* refactor: remove disableMigrationsListValidation

* refactor: make Step optional in ExecutionStep

* refactor: make Flow optional in Step
This commit is contained in:
Ali BARIN
2022-04-08 11:27:46 +02:00
committed by GitHub
parent 45f810b5b8
commit 75eda7f2af
34 changed files with 320 additions and 143 deletions

View File

@@ -4,12 +4,11 @@ import express, { Request, Response, NextFunction } from 'express';
import cors from 'cors';
import corsOptions from './config/cors-options';
import graphQLInstance from './helpers/graphql-instance';
import logger from './helpers/logger';
import morgan from './helpers/morgan';
import appAssetsHandler from './helpers/app-assets-handler';
import webUIHandler from './helpers/web-ui-handler';
import errorHandler from './helpers/error-handler';
import './config/database';
import './config/orm';
import {
createBullBoardHandler,
serverAdapter,
@@ -21,7 +20,6 @@ if (appConfig.appEnv === 'development') {
}
const app = express();
const port = appConfig.port;
if (appConfig.appEnv === 'development') {
injectBullBoardHandler(app, serverAdapter);
@@ -44,6 +42,4 @@ app.use(function (req: Request, res: Response, next: NextFunction) {
app.use(errorHandler);
app.listen(port, () => {
logger.info(`Server is listening on ${port}`);
});
export default app;