Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankfang/nextjs-typeorm-good
https://github.com/frankfang/nextjs-typeorm-good
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/frankfang/nextjs-typeorm-good
- Owner: FrankFang
- Created: 2020-07-19T20:05:52.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-26T22:03:19.000Z (almost 2 years ago)
- Last Synced: 2024-04-17T00:07:40.722Z (7 months ago)
- Language: TypeScript
- Size: 1.51 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 代码使用
请下载本代码,然后用 WebStorm 或者 VSCode 打开。
## 启动数据库
如果你没有创建过数据库,请运行
```bash
mkdir blog-data
docker run -v "$PWD/blog-data":/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_USER=blog -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:12.2或者旧版 Windows Docker 客户端运行下面的代码
docker run -v "blog-data":/var/lib/postgresql/data -p 5432:5432 -e POSTGRES_USER=blog -e POSTGRES_HOST_AUTH_METHOD=trust -d postgres:12.2
```如果你创建过数据库,请运行
```bash
docker ps -a
docker restart 容器id
```## 创建数据库
```
docker exec -it bash
psql -U blog
CREATE DATABASE blog_development ENCODING 'UTF8' LC_COLLATE 'en_US.utf8' LC_CTYPE 'en_US.utf8';
```## 数据表
首先修改 ormconfig.json 中的 host,然后运行
```
yarn m:run
```## 开发
```bash
yarn dev
# or
npm run dev
```## 部署
```bash
ssh blog@dev1 'sh /home/blog/app/bin/deploy.sh'
``````bash
yarn install --production=false
yarn build
docker build -t fang/node-web-app .
docker run --network=host -p 3000:3000 -d fang/node-web-app
```