Merge branch 'main' of git.odit.services:lfk/backend into main

This commit is contained in:
2020-11-24 20:08:45 +01:00
5 changed files with 18 additions and 23 deletions

View File

@@ -9,18 +9,11 @@ const app = express();
const PORT = process.env.APP_PORT || 4010;
createConnection()
.then((connection) => {
app.get('/', (req, res) => {
const encoded = jwt.sign({ key: 'value' }, 'secret');
consola.info(encoded);
return res.send('Express + TypeScript Server');
});
app.listen(PORT, () => {
consola.success(`⚡️[server]: Server is running at http://localhost:${PORT}`);
});
})
.then((connection) => {})
.catch((err) => {
consola.error(err);
})
.finally(() => {
app.get('/', (req, res) => {
const encoded = jwt.sign({ key: 'value' }, 'secret');
consola.info(encoded);

11
src/ormconfig.ts Normal file
View File

@@ -0,0 +1,11 @@
import { config } from 'dotenv-safe';
config();
export default {
type: process.env.DB_TYPE,
host: process.env.DB_HOST,
port: process.env.DB_PORT,
username: process.env.DB_USER,
password: process.env.DB_PASSWORD,
database: process.env.DB_NAME
};