make
: start database locally
go run src/sidan-backend.go
: start service locally
The service should connect automatically to the local database. To
change configfile (from the default config/local.yaml
), you can set
the CONFIG_FILE
env parameter pointing to an the new config-file.
under /
:
db/
: database migrationsstatic/
: static files served by (for instance)file
endpoint.config/
: different configs for different cases.apis/
: files defining old and new apis.- code under
src/
:src/router/
: defines the endpointssrc/database/
: defines models and database apis.src/config/
: define and parses the config
http://chalmerslosers.com:9000/service-inspector/Clac3
Download wsdl to apis/Clac3.xml
, then run node wsdl_to_swagger.js
to generate the swagger yaml.
-
Language: Golang
-
Test locally
-
Tests for APIs
-
Docker + env variables for choosing local/test/prod configs
-
Other config in yaml files
-
(optional) New tables and migrate data.
-
Content-Type: application/json
-
/auth/ - for authorization and forgot password etc.
-
/file/ - for image uploads
-
/mail/ - for mailing the reset password
-
/notify/ - for sending notifications
-
/db/ - all database queries and calls
-
GET for querying
-
PUT for creation
-
POST for modification
-
DELETE for removal
-
(optional) HEAD on API should give back a header with a description string.
-
(optional) GET on base URIs should give back a documented list on available APIs.
Check swagger.json
for full API.
For oAuth2 flows, please see https://developers.google.com/oauthplayground/
These functions operate on the database.
Check under src/database/models/
to see what format the JSON request
should have.
Send new mail.
JSON payload structure:
{"from_email": "", "to_emails": [], "message": "", "title": ""}
Fetch a file resource from the `/static/` directory.
Upload a new image file via form data.
Supported image types:
- gif
- png
- jpeg
Max size 10 MB
curl -F ‘data=@path/to/local/file' -X put