Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
LDmoxeii committed May 5, 2024
1 parent f95daae commit 1a9d14e
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 12 deletions.
6 changes: 4 additions & 2 deletions cli/start.zsh
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
rm -rf log; mkdir log

nginx -p . -c nginx.conf
zsh cli/db.zsh

curl "http://localhost:728/quit"
# curl "http://localhost:728/quit"
sleep 0.5
deno run --allow-net --allow-read cli/ser.js


deno run --allow-net --allow-read cli/ser.js
6 changes: 4 additions & 2 deletions cli/stop.zsh
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
mongosh --eval "db.shutdownServer()"
curl "http://localhost:728/quit"
nginx -squit
mongod --shutdown
mongosh --eval "db.shutdownServer()"
# curl "http://localhost:728/quit"
5 changes: 1 addition & 4 deletions ismism.ts/ui/bind/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
import type { Que, QueRet } from "../../src/pra/que.ts"
import { json_s } from "../../src/ont/json.ts"

// 服务:端口
const ser = `http://localhost:728`

// 绑定数据(浏览器端)<->(服务器端)

// 查询接口
Expand All @@ -13,7 +10,7 @@ export async function que<
q: Que
) {
const s = json_s(q)
const r = (await fetch(`${ser}/q?${s}`)).json() // HTTP GET 请求
const r = (await fetch(`/q?${s}`)).json() // HTTP GET 请求
console.log(`GET ${s}`)
return r as unknown as T
}
Expand Down
4 changes: 2 additions & 2 deletions ismism.ts/ui/index/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
<title>主义主义</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="refresh" content="3600">
<link rel="icon" type="image/png" sizes="32x32" href="//s1.ax1x.com/2023/06/15/pCu2bZQ.png">
<!-- <link rel="icon" type="image/png" sizes="32x32" href="//s1.ax1x.com/2023/06/15/pCu2bZQ.png">
<link rel="icon" type="image/png" sizes="16x16" href="//s1.ax1x.com/2023/06/15/pCu2LIs.png">
<link rel="icon" type="image/png" href="//s1.ax1x.com/2023/06/15/pCu25xf.png">
<link rel="apple-touch-icon" sizes="180x180" href="//s1.ax1x.com/2023/06/15/pCu25xf.png">
<link rel="apple-touch-icon" sizes="180x180" href="//s1.ax1x.com/2023/06/15/pCu25xf.png"> -->
</head>

<template></template>
Expand Down
2 changes: 1 addition & 1 deletion mongod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ storage:
net:
bindIp: 127.0.0.1, ::1
setParameter:
notablescan: 1
notablescan: 1
40 changes: 40 additions & 0 deletions nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
events {
worker_connections 64;
multi_accept on;
}

http { # 配置 HTTP 服务
access_log log/access.log combined; # 日志文件的位置和格式
error_log log/error.log error;

types {
text/html html;
}

upstream ismism { # 服务
server 127.0.0.1:728;
keepalive 2;
}

server {
listen 80 default_server;

root ui; # 静态文件的根目录

location = / { # "http://localhost"
try_files /index.html =444;
}

# "http://localhost/mod/marked.js" -> /ui/mod/marked.js
location /mod {}

# "http://localhost/q?que="adm" -> http://127.0.0.1:728/q?que="adm"
location /q {
proxy_pass http://ismism;
}

location /p {
proxy_pass http://ismism;
}
}
}
3 changes: 2 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
- `pre.ts` 创建操作 `pre-data` `prepare` (的操作组合)
- `put.ts` 更新操作 `put-data`(的操作组合)
- `pos.ts` 请求接口 `post` `HTTP POST` 对操作组合做请求
* `ser.ts` 服务接口 `serve`
* `ser.ts` 服务 `serve`
* `tst` 测试代码 `tests`
* `ui` 图形界面 `graphical user interface`
* `index` UI声明(HTML/CSS)
Expand All @@ -58,6 +58,7 @@
- `start.zsh` 启动服务
* `*ui` 图形界面(运行环境)(浏览器端)
- `*index.html` 网页界面
* `*ssl` 域名证书和签名
* `mongod.service` `mongod.yaml` 数据库配置(服务器端)
* `nginx.conf` 端口配置(服务器端)

Expand Down

0 comments on commit 1a9d14e

Please sign in to comment.