Skip to content

Commit bb24d34

Browse files
authored
Update README.md
Link to new server API
1 parent 6b921a8 commit bb24d34

File tree

1 file changed

+3
-45
lines changed

1 file changed

+3
-45
lines changed

ObjectService/README.md

Lines changed: 3 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -26,50 +26,8 @@ You can technically manually call the `uploaddat` route but this is intended pri
2626
- `sudo journalctl -u objectservice.service`
2727

2828
## API
29-
30-
### GET
31-
- `/objects/list`
32-
- Description: Returns a list of all objects indexed/available to view/download from the repository. Primary purpose is for all consumers to do object discovery.
33-
- Example: `https://openloco.leftofzen.dev/objects/list`
34-
- `/objects/getdat?{objectName}&{checksum}&{returnObjBytes}`
35-
- Description: Returns a specific object keyed off its object name and checksum. Primary purpose is for the Object Editor to retrieve objects and metadata.
36-
- Parameters:
37-
- `objectName`: the name of the object as per it's S5Header::Name property.
38-
- `checksum`: the checksum of the file as per its S5Header::Checksum property.
39-
- `returnObjBytes`: an optional parameter. `true` is you want the original byte[] for the object to be included, `false` if not.
40-
- Example: `https://openloco.leftofzen.dev/objects/getdat?objectName=M6SBO&checksum=2032077333&returnObjBytes=false`
41-
- `/objects/getobject?{uniqueObjectId}&{returnObjBytes}`
42-
- Description: Returns a specific object keyed off its unique ID in the repository. Primary purpose is for the Object Editor to retrieve objects and metadata.
43-
- Parameters:
44-
- `uniqueObjectId`: the unique ID of an object in the repository.
45-
- `returnObjBytes`: an optional parameter. `true` is you want the original byte[] for the object to be included, `false` if not.
46-
- Example: `https://openloco.leftofzen.dev/objects/getobject?uniqueObjectId=1024&returnObjBytes=false`
47-
- `/objects/getdatfile?{objectName}&{checksum}`
48-
- Description: Returns a dat file keyed off its object name and checksum. Primary purpose is for OpenLoco to download specific objects.
49-
- Parameters:
50-
- `objectName`: the name of the object as per it's S5Header::Name property.
51-
- `checksum`: the checksum of the file as per its S5Header::Checksum property.
52-
- Example: `https://openloco.leftofzen.dev/objects/getdatfile?objectName=M6SBO&checksum=2032077333`
53-
- `/objects/getobjectfile?{uniqueObjectId}`
54-
- Description: Returns a dat file keyed off its unique ID in the repository. Primary purpose is for OpenLoco to download specific objects.
55-
- Parameters:
56-
- `uniqueObjectId`: the unique ID of an object in the repository.
57-
- Example: `https://openloco.leftofzen.dev/objects/getobjectfile?uniqueObjectId=1024`
58-
59-
### POST
60-
- `/objects/uploaddat`
61-
- Uploads a given dat file to the object repository.
62-
- Content type: `application/json`
63-
- Parameters:
64-
- `datBytesAsBase64`: a string that is the base64 encoding of the raw bytes of the dat file
65-
- `creationDate`: a `DateTimeOffset` representing the creation date of the dat file. If using the Object Editor, it will use [`File.GetLastWriteTimeUtc()`](https://learn.microsoft.com/en-us/dotnet/api/system.io.file.getlastwritetimeutc?view=net-8.0), which on Windows is the "Modified" time for a file. For historical dat files, this is the only way to get a creation date and it may be incorrect or inaccurate.
66-
- Example request body:
67-
```
68-
{
69-
"datBytesAsBase64": "c29tZSBraW5kIG9mIGVhc3RlciBlZ2c=",
70-
"creationDate": "2024-08-29T08:52:17.372Z"
71-
}
72-
```
29+
- See https://openloco.leftofzen.dev/api/
30+
- To check status of the service, query https://openloco.leftofzen.dev/health/
7331

7432
## Technical Details
7533

@@ -81,4 +39,4 @@ You can technically manually call the `uploaddat` route but this is intended pri
8139
### Web Server
8240
- The API is rate-limited to a burst limit of [20 requests per second](https://github.com/OpenLoco/ObjectEditor/blob/master/ObjectService/ObjectServiceRateLimitOptions.cs) with 10 tokens replenished every second. This is a global limit, regardless of client. This will be [changed in the future](https://github.com/OpenLoco/ObjectEditor/issues/76).
8341
- The server runs on a spare PC I have converted into a Linux (Ubuntu) server. It runs the Object Service as a daemon under systemctl and has an auto-restart configured in case it crashes.
84-
- The domain is registered with Cloudflare. I have a `cloudflared` daemon running on the server that connects Cloudflare's servers and DNS lookup/routing to the server. This tunnel/daemon/Cloudflare hosting setup also acts as a reverse-proxy meaning I don't need to worry about load-balancing or exposing my public IP address to anyone.
42+
- The domain is registered with Cloudflare. I have a `cloudflared` daemon running on the server that connects Cloudflare's servers and DNS lookup/routing to the server. This tunnel/daemon/Cloudflare hosting setup also acts as a reverse-proxy meaning I don't need to worry about load-balancing or exposing my public IP address to anyone.

0 commit comments

Comments
 (0)