autokueng-api

command module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 2, 2022 License: Apache-2.0 Imports: 11 Imported by: 0

README

Autoküng API

The autokueng.ch website api

PostgreSQL

Run Test PostgreSQL docker instance:

docker run -it -p 5432:5432 -d -e POSTGRES_HOST_AUTH_METHOD=trust postgres
Env Variables

Set the following env variables:
database

export DB_USERNAME=postgres
export DB_PASSWORD=
export DB_NAME=postgres
export DB_HOST=localhost

jwt secret

# must be the same as in autokueng data api
export JWT_SECRET_KEY=<secret>

user recovery/administration mode if you want to reset the password of a user or register a new one, set the following env variable:

export USER_ADMIN=enabled

recaptcha secret

export CAPTCHA_SECRET=<secret>

smtp

export SMTP_HOST=smtp.gmail.com
export SMTP_Port=465
export SMTP_Username=test@gmail.com
export SMTP_Password=thispassword
export SMTP_From=kontakttest@gmail.com
export SMTP_To=infotest@gmail.com
export SMTP_SSL=true

API Reference

The Autokueng API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, ans uses standard HTTP response codes, authentication, and verbs.

Authentication

The authentication is done via JWT.

URL Method Data Description
/api/v1/login POST username(string), password(string) Login to the API
/api/v1/auth GET username, Id Checks if user is logged in and sends back username and userId, Is used to check if user is authenticated
User Administration

The user administration is done via the USER_ADMIN env variable.

URL Method Data Description
/api/v1/admin/register POST username(string), password(string) Register new Admin User
/api/v1/admin/reset-password POST username(string), password(string) Reset Passwort of given provided username
News

The news route is used to get and set the news article displayed on the front page.

URL Method Data Description
/api/v1/news GET title, content, picture Get news article
/api/v1/news POST title, content, picture Set news article
/api/v1/news DELETE nothing Delete all news articles
Services

tbd.

Firma

tbd.

tbd.

Kontakt

tbd.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
autokueng-api - Open-Source Website
autokueng-api - Open-Source Website
autokueng-api - Open-Source Website
autokueng-api - Open-Source Website

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL