https://github.com/dcramer/cask-server
https://github.com/dcramer/cask-server
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/dcramer/cask-server
- Owner: dcramer
- License: apache-2.0
- Created: 2018-08-07T16:08:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T02:22:25.000Z (about 3 years ago)
- Last Synced: 2025-04-02T12:54:02.625Z (9 months ago)
- Language: Python
- Size: 89.8 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cask-server
## Install
```shell
$ brew install postgresql postgis
$ pipenv sync
$ psql -c 'create extension postgis;' -U postgres
$ createdb -E utf-8 cask
$ pipenv run python manage.py migrate
$ pipenv run python manage.py runserver
```
## API
The API is a GraphQL implementation powered by Graphene. The endpoint is ``/graphql/``.
Authentication is done via the following:
1. Perform a login mutation:
```graphql
mutation{
login(email:"foo@example.com", password:"bar"){
errors
ok
token,
user {id, email, name}
}
}
```
2. Capture the token in the response and send it with future requests:
```http
Authorization: Token {value}
```
Here's a helpful app which lets you bind an auth header:
https://github.com/skevy/graphiql-app