admin-nestjs
v0.0.10
Published
<h3 align="center"> A generic administration interface for TypeORM entities </h3>
Downloads
22
Readme
import { AdminModule } from 'admin-nestjs/typeorm';
@Module({
imports: [
AdminModule.forRoot([User, Post], dataSource)
]
})
export class AppModule {}
DataSource
It must be initialized and connected to the database beforehand, otherwise the repositories will not work.
import { DataSource } from 'typeorm';
import { User, Post } from './entities';
const AppDataSource = new DataSource({
type: 'postgres',
host: 'localhost',
port: 5432,
username: 'postgres',
password: '123',
database: 'mydb',
entities: [User, Post],
synchronize: true,
});
await AppDataSource.initialize();