Starter project for the Eicrud framework.
-
rename
.env.sample
to.env
(change your token with something secure) -
npm install
-
npm run start
This repository is configured for mongoDB, to switch to postgreSQL do the following :
-
run
npm i @eicrud/postgresql
-
update your
src/eicrud.config.service.ts
import { PostgreDbAdapter } from "@eicrud/postgresql";
@Injectable()
export class MyConfigService extends CrudConfigService {
constructor(
// ...
) {
super({
// ...
dbAdapter: new PostgreDbAdapter(),
});
- run
npm i @mikro-orm/postgresql
- update your
src/app.module.ts
import { PostgreSqlDriver } from '@mikro-orm/postgresql';
@Module({
imports: [
//...
MikroOrmModule.forRoot({
entities: [...CRUDEntities],
// ...
driver: PostgreSqlDriver,
user: "postgres",
password: "your_password_here",
//...