Sample CRUD built using expressjs and typeorm using typescript.
To install dependencies:
yarn install
Sample .env
file will look like;
TYPEORM_CONNECTION = mysql
TYPEORM_HOST = 0.0.0.0
TYPEORM_USERNAME = xxxx
TYPEORM_PASSWORD = xxxx
TYPEORM_DATABASE = typeorm
TYPEORM_PORT = 3306
TYPEORM_SYNCHRONIZE = true
TYPEORM_LOGGING = true
TYPEORM_ENTITIES = dist/entity/**/*.js
TYPEORM_MIGRATIONS_DIR= src/migration/
TYPEORM_MIGRATIONS= src/migration/**/*.ts
To run the project (runs in port 5000
):
yarn start
This project contains basic CRUD
operation using TypeORM
and Express
with typescript configuration.
API:
GET photo
get all photosGET photo/:id
get one photoPOST photo/
insert into photoDELETE photo/:id
delete from photoPUT photo/:id
update photo