-
-
Save amandeepmittal/d3c872c980a10075dc0ab45410e40c9c to your computer and use it in GitHub Desktop.
This file contains 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 } from 'typeorm'; | |
import { Photo } from './entity/Photo'; | |
createConnection({ | |
type: 'mysql', | |
host: 'localhost', | |
port: 3306, | |
username: 'root', | |
password: 'admin', | |
database: 'test', | |
entities: [Photo], | |
synchronize: true, | |
logging: false | |
}) | |
.then(connection => { | |
// here you can start to work with your entities | |
}) | |
.catch(error => console.log(error)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment