Compare commits
4 Commits
01a786720b
...
529ebb2a8f
Author | SHA1 | Date | |
---|---|---|---|
529ebb2a8f | |||
f854f137e5 | |||
3c389937b7 | |||
0b92d82a5b |
1
.gitignore
vendored
1
.gitignore
vendored
@ -128,3 +128,4 @@ dist
|
|||||||
.pnp.*
|
.pnp.*
|
||||||
yarn.lock
|
yarn.lock
|
||||||
package-lock.json
|
package-lock.json
|
||||||
|
build
|
||||||
|
11
ormconfig.ts
11
ormconfig.ts
@ -1,11 +0,0 @@
|
|||||||
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
|
|
||||||
}
|
|
@ -24,6 +24,7 @@
|
|||||||
"typescript": "^4.1.2"
|
"typescript": "^4.1.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "nodemon src/app.ts"
|
"dev": "nodemon src/app.ts",
|
||||||
|
"build": "tsc"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
13
src/app.ts
13
src/app.ts
@ -9,18 +9,11 @@ const app = express();
|
|||||||
const PORT = process.env.APP_PORT || 4010;
|
const PORT = process.env.APP_PORT || 4010;
|
||||||
|
|
||||||
createConnection()
|
createConnection()
|
||||||
.then((connection) => {
|
.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}`);
|
|
||||||
});
|
|
||||||
})
|
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
consola.error(err);
|
consola.error(err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
app.get('/', (req, res) => {
|
app.get('/', (req, res) => {
|
||||||
const encoded = jwt.sign({ key: 'value' }, 'secret');
|
const encoded = jwt.sign({ key: 'value' }, 'secret');
|
||||||
consola.info(encoded);
|
consola.info(encoded);
|
||||||
|
11
src/ormconfig.ts
Normal file
11
src/ormconfig.ts
Normal 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
|
||||||
|
};
|
Loading…
x
Reference in New Issue
Block a user