Compare commits
No commits in common. "01a786720b5c58cbac9fd8745b1f34932941dee1" and "84fee8b19ae3c10ddfd06883816b59c4d7ccf620" have entirely different histories.
01a786720b
...
84fee8b19a
@ -6,9 +6,7 @@
|
||||
"author": "Philipp Dormann <philipp.dormann1@gmail.com>",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"consola": "^2.15.0",
|
||||
"express": "^4.17.1",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"mysql": "^2.18.1",
|
||||
"pg": "^8.5.1",
|
||||
"typeorm": "^0.2.29"
|
||||
@ -16,7 +14,6 @@
|
||||
"devDependencies": {
|
||||
"@types/dotenv-safe": "^8.1.1",
|
||||
"@types/express": "^4.17.9",
|
||||
"@types/jsonwebtoken": "^8.5.0",
|
||||
"@types/node": "^14.14.9",
|
||||
"dotenv-safe": "^8.2.0",
|
||||
"nodemon": "^2.0.6",
|
||||
|
24
src/app.ts
24
src/app.ts
@ -1,32 +1,18 @@
|
||||
import * as dotenvSafe from 'dotenv-safe';
|
||||
import express from 'express';
|
||||
import consola from 'consola';
|
||||
import * as jwt from 'jsonwebtoken';
|
||||
import { createConnection } from 'typeorm';
|
||||
|
||||
dotenvSafe.config();
|
||||
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');
|
||||
});
|
||||
const app = express();
|
||||
const PORT = process.env.APP_PORT || 4010;
|
||||
app.get('/', (req, res) => res.send('Express + TypeScript Server'));
|
||||
app.listen(PORT, () => {
|
||||
consola.success(`⚡️[server]: Server is running at http://localhost:${PORT}`);
|
||||
console.log(`⚡️[server]: Server is running at http://localhost:${PORT}`);
|
||||
});
|
||||
})
|
||||
.catch((err) => {
|
||||
consola.error(err);
|
||||
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}`);
|
||||
});
|
||||
console.log(err);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user