mirror of
https://github.com/glimpse-app/server.git
synced 2025-04-02 10:52:45 -04:00
This is the API server.
.vscode | ||
src | ||
tests | ||
.gitignore | ||
bin.dockerfile | ||
dockerfile | ||
LICENSE | ||
nim.cfg | ||
README.md | ||
server.nimble |
Glimpse API server
This is the Glimpse API server.
Run test server instance
Install needed libraries:
nimble install jester norm checksums
Compile and run:
nimble run
Build project:
nimble build
Docker
To compile the binary only, run the following (executable will be found in /bin/
):
docker buildx build -t glimpse-server:latest --output=bin --target=runner -f
To deploy an instance of the server within docker, run:
docker buildx build -t glimpse-server:latest .
docker run -it --rm -p 5000:5000 glimpse-server:latest
Use the following to run a temporary PostgreSQL database, (DO NOT USE IN PRODUCTION):
docker run -it --rm -e POSTGRES_USER=user -e POSTGRES_PASSWORD=postgres -p 5432:5432 postgres
API Endpoints
Each endpoint has comments describing what type of request it is and what parameters it takes.
Example requests using cURL
:
curl -X <POST|GET|PUT|DELETE> <Endpoint URI> -H '<Request Body Contents>'
curl -X POST http://localhost:5000/api/v1/newUser -H 'Username=Array' -H 'Password=i8Vl8XZaVRiZFsZ'
curl -X POST -H "Authorization: <access_token>" -F "file=@image.png" http://localhost:5000/api/v1/newFile