update
This commit is contained in:
parent
f8b7030fca
commit
4f471b1fea
16
README.md
16
README.md
|
@ -1,2 +1,18 @@
|
|||
# SeoServer
|
||||
|
||||
#### 依赖安装、运行
|
||||
|
||||
```bash
|
||||
// 依赖
|
||||
npm install
|
||||
npm install pm2 -g
|
||||
node node_modules/puppeteer/install.js // 安装无头浏览器,可能会缺依赖,可参见https://www.cnblogs.com/ilizhu/p/14504049.html
|
||||
|
||||
// 启动服务
|
||||
pm2 start index.js
|
||||
|
||||
```
|
||||
|
||||
|
||||
#### 配置
|
||||
config中修改redis地址端口、node服务端口、以及转发host
|
|
@ -0,0 +1,5 @@
|
|||
export const redis = 'redis://127.0.0.1:26379';
|
||||
export const host = 'https://www.gitlink.org.cn';
|
||||
// export const host = 'http://119.3.190.9:8000';
|
||||
|
||||
export const port = 3000;
|
5
index.js
5
index.js
|
@ -1,12 +1,9 @@
|
|||
import request from 'request';
|
||||
import express from 'express';
|
||||
import ssr from './ssr.js';
|
||||
import { port, host } from './config.js';
|
||||
|
||||
const app = express()
|
||||
const port = 3000
|
||||
|
||||
// const host = 'https://www.gitlink.org.cn';
|
||||
const host = 'http://119.3.190.9:8000';
|
||||
|
||||
app.get('/api/*', async (req, res) => {
|
||||
request(`${host}${req.url}`).pipe(res);
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { createClient } from 'redis';
|
||||
|
||||
const url = 'redis://127.0.0.1:26379'
|
||||
import { redis as url } from '../config.js';
|
||||
|
||||
const client = createClient({
|
||||
url: url,
|
||||
|
|
Loading…
Reference in New Issue