You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This Go project exposes a small HTTP API over the JSON data exported by [ixion](https://github.com/thewakingsands/ixion)'s strings export. Data is loaded from the [ixion releases](https://github.com/thewakingsands/ixion/releases): on startup the server fetches the latest release and, if needed, downloads `strings.zip`, extracts it, and builds a search index. Queries use the current version's data.
3
+
This Go project exposes a small HTTP API over the JSON data exported by
4
+
[ixion](https://github.com/thewakingsands/ixion)'s strings export. Data is
5
+
loaded from the
6
+
[ixion releases](https://github.com/thewakingsands/ixion/releases): on startup
7
+
the server fetches the latest release and, if needed, downloads `strings.zip`,
8
+
extracts it, and builds a search index. Queries use the current version's data.
4
9
5
10
### Building and running
6
11
@@ -13,7 +18,7 @@ go run .
13
18
By default the server:
14
19
15
20
- Listens on `127.0.0.1:8080`
16
-
- Uses `data/` as the root directory for app data (see below)
21
+
- Uses `data/` as the root directory for app data
17
22
18
23
Override with flags:
19
24
@@ -23,18 +28,22 @@ go run . -addr=":8090" -data="/path/to/data"
23
28
24
29
### Data directory layout
25
30
26
-
The `-data` path is the **root** for all app data. The server expects or creates:
31
+
The `-data` path is the root for all app data. The server expects or creates:
27
32
28
-
-`data/version`— text file with the current version (e.g. `publish-20260303-8b409c8`)
29
-
-`data/strings/<version>/`— extracted JSON files from `strings.zip`
30
-
-`data/index/<version>/`— Bleve search index for that version
33
+
-`data/version`- text file with the current version, for example `publish-20260303-8b409c8`
34
+
-`data/strings/<version>/`- extracted JSON files from `strings.zip`
35
+
-`data/index/<version>/`- Bleve search index for that version
31
36
32
-
On first run (or when the version changes), the server will fetch the latest [ixion release](https://github.com/thewakingsands/ixion/releases/latest), download `strings.zip`, extract to `data/strings/<version>/`, and build the index under `data/index/<version>/`.
37
+
On first run, or when the version changes, the server fetches the latest
downloads `strings.zip`, extracts to `data/strings/<version>/`, and builds the
40
+
index under `data/index/<version>/`.
33
41
34
42
### Version and update
35
43
36
-
-**GET /api/version** — returns the current data version, e.g. `{"version":"publish-20260303-8b409c8"}`.
37
-
-**POST /api/version** — triggers a version check and, if the latest release differs from local, downloads and indexes the new data, then reloads the store. Requires a `token` query parameter that matches the environment variable `XIVSTRINGS_UPDATE_TOKEN`. If `XIVSTRINGS_UPDATE_TOKEN` is not set, POST returns `403` and update is not allowed.
44
+
-`GET /api/version` returns the current data version and the latest update status
45
+
-`POST /api/version?token=...` starts an async update job and returns `202 Accepted`
46
+
- Full update API details: [docs/update-api.md](docs/update-api.md)
38
47
39
48
Example:
40
49
@@ -43,10 +52,10 @@ Example:
43
52
export XIVSTRINGS_UPDATE_TOKEN=your-secret-token
44
53
go run .
45
54
46
-
# Query current version (no auth)
55
+
# Query current version and update status
47
56
curl http://127.0.0.1:8080/api/version
48
57
49
-
# Trigger update (with token)
58
+
# Trigger async update
50
59
curl -X POST "http://127.0.0.1:8080/api/version?token=your-secret-token"
51
60
```
52
61
@@ -68,26 +77,17 @@ Each JSON file under the strings directory contains an array of items:
68
77
69
78
### HTTP APIs
70
79
71
-
-**Search strings**
72
-
73
-
-**Endpoint**: `GET /api/search`
74
-
-**Query parameters**:
75
-
-`lang` (required): language code, e.g. `en`, `ja`, `chs`
76
-
-`q` (required): substring to search for in the given language
77
-
-`sheet` (optional): restrict search to a specific sheet name
78
-
-`offset` (optional): offset of the first item to return (default 0)
79
-
-`limit` (optional): maximum number of items to return (default 100, max 1000)
80
-
-**Response**: JSON with matching items and meta (total, elapsed).
81
-
82
-
-**Get items by sheet**
83
-
84
-
-**Endpoint**: `GET /api/items`
85
-
-**Query parameters**:
86
-
-`sheet` (required): sheet name
87
-
-`offset` (optional): offset (default 0)
88
-
-`limit` (optional): max items (default 100, max 1000)
89
-
-**Response**: JSON with items for the sheet and meta.
90
-
91
-
-**Version**
92
-
-**GET /api/version**: current data version.
93
-
-**POST /api/version?token=...**: run update from ixion release (requires `XIVSTRINGS_UPDATE_TOKEN`).
0 commit comments