Skip to content

Commit

Permalink
fix local refresh page problem
Browse files Browse the repository at this point in the history
  • Loading branch information
MorvanZhou committed Nov 3, 2023
1 parent 62d6319 commit 19c0167
Show file tree
Hide file tree
Showing 15 changed files with 2,764 additions and 2,020 deletions.
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,15 @@ pip install -U rethink-note

## Usage

Run with default settings:
Quickly start the note web service with `rethink.run()`:

```python
import rethink

rethink.run()
```

Run with custom settings:
If you need more custom running settings, you can use the parameters of `rethink.run()`:

```python
import rethink
Expand All @@ -50,3 +50,10 @@ rethink.run(
language="zh" # language, default is English, optional: zh, en
)
```

All notes will be stored in the path specified by `path`,
and the `.data` folder will be created in the current directory by default.
If you want to create a data folder in another path, you can use the `path` parameter.

English and Chinese languages are supported, and the default is English `en`.
If you want to use Chinese `zh`, you can use `language="zh"` parameter.
9 changes: 7 additions & 2 deletions README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,15 @@ pip install -U rethink-note

## 使用

使用默认设置运行
使用 `rethink.run()` 方式,快速启动笔记 web 服务

```python
import rethink

rethink.run()
```

使用自定义设置运行
如果需要更多自定义运行设置,可以使用 `rethink.run()` 的参数

```python
import rethink
Expand All @@ -51,3 +51,8 @@ rethink.run(
language="zh" # 语言,默认为英语。可选值:zh, en
)
```

所有笔记都会被存储在 `path` 路径下,默认会在当前目录下创建 `.data`
文件夹。如果你想在其他路径创建数据文件夹,可以使用 `path` 参数。

当前语言暂时只英语和中文,且默认为英文 `en`,如果你想使用中文 `zh`,可以使用 `language` 参数。
6 changes: 4 additions & 2 deletions src/rethink/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,11 @@ async def startup_event():


@app.get("/", response_class=HTMLResponse)
@app.get("/r", response_class=HTMLResponse)
@app.get("/user", response_class=HTMLResponse)
@app.get("/login", response_class=HTMLResponse)
@app.get("/about", response_class=HTMLResponse)
@app.get("/r", response_class=HTMLResponse)
@app.get("/r/{path}", response_class=HTMLResponse)
@app.get("/n/{nid}", response_class=HTMLResponse)
async def index() -> HTMLResponse:
content = (const.FRONTEND_DIR / "index.html").read_text(encoding="utf-8")
content += f"<script>window.VUE_APP_API_PORT = {os.getenv('VUE_APP_API_PORT')}</script>"
Expand Down
Loading

0 comments on commit 19c0167

Please sign in to comment.