Created
October 18, 2020 09:26
-
-
Save davidcsejtei/fd48018494b569104f27bac6c4d4137e to your computer and use it in GitHub Desktop.
TypeORM - index.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import "reflect-metadata"; | |
| import {createConnection, ConnectionOptions} from "typeorm"; | |
| import http from "http"; | |
| import express from 'express'; | |
| import config from "../ormconfig.json"; | |
| createConnection(config as ConnectionOptions).then(async connection => { | |
| const app = express(); | |
| app.use(express.json()); | |
| const server = new http.Server(app); | |
| server.listen(3001); | |
| }).catch(error => { | |
| console.log(error); | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment