parent
79f883fc31
commit
0d870be23c
7
.env.example
Normal file
7
.env.example
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
APP_PORT=4010
|
||||||
|
DB_TYPE=bla
|
||||||
|
DB_HOST=bla
|
||||||
|
DB_PORT=bla
|
||||||
|
DB_USER=bla
|
||||||
|
DB_PASSWORD=bla
|
||||||
|
DB_NAME=bla
|
23
src/app.ts
23
src/app.ts
@ -1,9 +1,18 @@
|
|||||||
import * as dotenvSafe from 'dotenv-safe';
|
import * as dotenvSafe from 'dotenv-safe';
|
||||||
dotenvSafe.config();
|
|
||||||
import express from 'express';
|
import express from 'express';
|
||||||
const app = express();
|
import { createConnection } from 'typeorm';
|
||||||
const PORT = 4010;
|
|
||||||
app.get('/', (req, res) => res.send('Express + TypeScript Server'));
|
dotenvSafe.config();
|
||||||
app.listen(PORT, () => {
|
|
||||||
console.log(`⚡️[server]: Server is running at http://localhost:${PORT}`);
|
createConnection()
|
||||||
});
|
.then((connection) => {
|
||||||
|
const app = express();
|
||||||
|
const PORT = process.env.APP_PORT || 4010;
|
||||||
|
app.get('/', (req, res) => res.send('Express + TypeScript Server'));
|
||||||
|
app.listen(PORT, () => {
|
||||||
|
console.log(`⚡️[server]: Server is running at http://localhost:${PORT}`);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.log(err);
|
||||||
|
});
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "es2017",
|
"target": "es2017",
|
||||||
"module": "esnext",
|
"module": "commonjs",
|
||||||
"rootDir": "./src",
|
"rootDir": "./src",
|
||||||
"outDir": "./build",
|
"outDir": "./build",
|
||||||
"esModuleInterop": true,
|
"esModuleInterop": true,
|
||||||
"strict": true,
|
"strict": true
|
||||||
"moduleResolution": "node"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user