Simple Go API to check whether an user is a Math student or not.
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
Francesco Minnocci f5e12d2cae
Initial commit
1 year ago
README.md Initial commit 1 year ago
main.go Initial commit 1 year ago

README.md

API to check for Maths students

Server Prerequisites

  • Having go installed
  • An environment variable AUTHPDS_TOKEN containing the authentication token for the external API.
  • An environment variable named SECRET containing the secret token for authorization.

Server Setup

  • Clone the repository:
    git clone https://git.phc.dm.unipi.it/phc/go-maths-api
    
  • Change directory and build the project:
    cd go-maths-api
    go build
    
  • Run with ./go-maths-api

Client Usage

An example request (with SECRET defined in your environment):

curl -X GET "http://localhost:8080/check-maths-user?SANITIZED_USER=f.minnocci" -H "Authorization: Bearer $SECRET"

Successful JSON response:

{
    "result": true
}