This commit is contained in:
黄心宇 2023-09-14 17:45:13 +08:00
parent f8b7030fca
commit 4f471b1fea
4 changed files with 23 additions and 6 deletions

View File

@ -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

5
config.js Normal file
View File

@ -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;

View File

@ -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);

View File

@ -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,