https://github.com/peterdee/koa-typescript
A Koa application with Typescript
https://github.com/peterdee/koa-typescript
Last synced: 10 months ago
JSON representation
A Koa application with Typescript
- Host: GitHub
- URL: https://github.com/peterdee/koa-typescript
- Owner: peterdee
- Created: 2020-03-03T06:12:49.000Z (over 6 years ago)
- Default Branch: stage
- Last Pushed: 2020-07-20T06:58:30.000Z (almost 6 years ago)
- Last Synced: 2025-01-21T10:11:16.691Z (over 1 year ago)
- Language: TypeScript
- Homepage: http://localhost:2020
- Size: 201 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## A Koa application with Typescript
This application is used for the Jenkins auto-deployment testing
Stack: [Koa](https://koajs.com/), [Node](https://nodejs.org/en/), [Sequelize](https://sequelize.org/), [Typescript](https://www.typescriptlang.org/)
### Environemt
The `.env` file is required
Check the [`.env.example`](.env.example) file for the list of the required environmental variables
### Deploy
Install and configure the [PostgreSQL](https://www.postgresql.org/download/) database
Deploy the project:
```shell script
git clone https://github.com/peterdee/koa-typescript
cd ./koa-typescript
nvm use 12.16.1
npm i -g sequelize-cli
npm i
```
### Launch
For the local deployment, run:
```shell script
npm run dev
```
For the staging, install the [PM2](https://www.npmjs.com/package/pm2) module:
```shell script
npm i -g pm2
pm2 install pm2-logrotate
```
Start the server with PM2:
```shell script
pm2 start npm --no-automation --name koa-typescript -- run prod
pm2 save
```
To restart the server, run:
```shell script
pm2 restart koa-typescript
```
To stop the server, run:
```shell script
pm2 delete koa-typescript
```
### Database migrations
Check the [MIGRATIONS.md](MIGRATIONS.md) file for more information