แก้ไฟล์ build
This commit is contained in:
parent
87c856b372
commit
7e792b59a7
4 changed files with 126 additions and 25 deletions
21
src/app.ts
21
src/app.ts
|
|
@ -13,9 +13,11 @@ async function main() {
|
|||
|
||||
const app = express();
|
||||
|
||||
app.use(cors({
|
||||
origin: "*",
|
||||
}));
|
||||
app.use(
|
||||
cors({
|
||||
origin: "*",
|
||||
}),
|
||||
);
|
||||
app.use(express.json());
|
||||
app.use(express.urlencoded({ extended: true }));
|
||||
app.use("/", express.static("static"));
|
||||
|
|
@ -24,15 +26,18 @@ async function main() {
|
|||
RegisterRoutes(app);
|
||||
|
||||
app.use(error);
|
||||
|
||||
const APP_HOST = process.env.APP_HOST || "0.0.0.0";
|
||||
const APP_PORT = +(process.env.APP_PORT || 3000);
|
||||
|
||||
// app.listen(APP_PORT, APP_HOST, () => console.log(`Listening on: http://localhost:${APP_PORT}`));
|
||||
app.listen(APP_PORT, APP_HOST, () => (
|
||||
console.log(`[APP] Application is running on: http://localhost:${APP_PORT}`),
|
||||
console.log(`[APP] Swagger on: http://localhost:${APP_PORT}/api-docs`)
|
||||
), );
|
||||
app.listen(
|
||||
APP_PORT,
|
||||
APP_HOST,
|
||||
() => (
|
||||
console.log(`[APP] Application is running on: http://localhost:${APP_PORT}`),
|
||||
console.log(`[APP] Swagger on: http://localhost:${APP_PORT}/api-docs`)
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
main();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export const AppDataSource = new DataSource({
|
|||
port: +(process.env.DB_PORT || 3306),
|
||||
username: process.env.DB_USERNAME,
|
||||
password: process.env.DB_PASSWORD,
|
||||
synchronize: true,
|
||||
synchronize: false,
|
||||
logging: true,
|
||||
entities: ["src/entities/**/*.ts"],
|
||||
migrations: ["src/migration/**/*.ts"],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue