Skip to content

eicrud/eicrud-starter

Repository files navigation

eicrud-starter

Starter project for the Eicrud framework.

Start the application

  1. rename .env.sample to .env (change your token with something secure)

  2. npm install

  3. npm run start

Change the Database

This repository is configured for mongoDB, to switch to postgreSQL do the following :

  1. run npm i @eicrud/postgresql

  2. update your src/eicrud.config.service.ts

import { PostgreDbAdapter } from "@eicrud/postgresql"; 

@Injectable()
export class MyConfigService extends CrudConfigService {

    constructor(
    // ...
    ) {
        super({
            // ...
            dbAdapter: new PostgreDbAdapter(),
        });
  1. run npm i @mikro-orm/postgresql
  2. 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",
    //...