Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankfang/nextjs-typeorm-done
https://github.com/frankfang/nextjs-typeorm-done
Last synced: 17 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/frankfang/nextjs-typeorm-done
- Owner: FrankFang
- Created: 2020-07-20T22:44:46.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-26T22:05:22.000Z (almost 2 years ago)
- Last Synced: 2024-04-17T00:07:40.635Z (7 months ago)
- Language: TypeScript
- Size: 1.42 MB
- Stars: 1
- Watchers: 2
- Forks: 2
- 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
git push
ssh blog@dev1 'bash -s' < bin/deploy.sh
```## 备忘
```bash
docker run --name nginx1 --network=host -v /home/blog/nginx.conf:/etc/nginx/conf.d/default.conf -v /home/
blog/app/.next/static/:/usr/share/nginx/html/_next/static/ -d nginx:1.19.1
```