https://github.com/codex-team/version.controller
https://github.com/codex-team/version.controller
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/codex-team/version.controller
- Owner: codex-team
- License: mit
- Created: 2019-02-26T13:50:40.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-03-31T17:26:44.000Z (over 6 years ago)
- Last Synced: 2024-12-31T05:28:36.214Z (12 months ago)
- Language: Lua
- Size: 7.81 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Version controller
Check package's updates and track versions in use.
## API
There is a simple one route API. CORS support is enabled.
### Request
Send a POST request to uri `/check-version`
| Field | Example | Description |
| ------- | -------------------- | ----------------------------------------- |
| package | `@editorjs/editorjs` | Name of the package to be checked |
| version | `2.10.0` | (optional) Current version of the package |
#### Example
```shell
curl -X POST http://localhost:8888/check-version -d "package=@editorjs/editorjs" -d "version=2.10.0"
```
### Response
For a success request the latest version will be returned.
```json
{
"version": "2.11.2"
}
```
On any error you will get an object with a field 'error'.
```json
{
"error": "Package name is missing"
}
```
```json
{
"error": "Method not allowed"
}
```
## Development
Run local server:
```shell
docker-compose up
```
To enable live lua code reloading uncomment the following string in the [`lua/package.lua`](lua/check-version.lua) file and reload the server.
```nginx
#lua_code_cache off;
```
Now you can send requests to `http://locahost:8888/check` url.