||
BE for Web development subject. This project uses Expressjs, typescript and Socket.io
Khóa CT6
||
Variable | Required | Purpose |
---|---|---|
DATABASE_URL | YES | your choosen database url |
AT_SECRET_KEY | YES | use to generate, verify accesstoken |
RT_SECRET_KEY | YES | use to generate, verify refreshtoken |
PORT | NO | port to run project, it is set to 8000 by default |
NODE_ENV | NO | environment, can take value of development or production |
APP_DOMAIN | YES | full domain when this come to deployment, also need to communicate with zalo |
CLIENT_DOMAIN | NO | client domain, need to specify to pass CORS |
CLIENT_PORT | NO | client port, like CLIENT_DOMAIN but used to develop in local |
ZALO_APP_ID | YES | defined in zalopay document, refer to app_id |
ZALO_KEY_1 | YES | provided by zalopay |
ZALO_KEY_2 | YES | provided by zalopay |
ZALO_ENDPOINT | YES | defined in zalopay document, refer to redirecturl |
For the full .env file example, check
out this template
For the usage of these above zalo's properties, check
out this zalopay document
first, clone this project
next, config your .env file
then setup prisma:
npm run db-generate
you can check the invalid code with this command:
npm run lint
you can run the development server in local by this command:
npm run dev
you can test app in production environment by running:
npm run build
npm run start
make build
make server