sportcenter-booking

module
v0.0.0-...-22bbd6f Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2022 License: MIT

README

sportcenter-booking

Online reservation for sport center's facilities

AWS sam

Building application

sam build
Local testing API
# start local api service
sam local start-api

# start local api service with custom environment variables and aws credential profile name
sam local start-api -n environments-dev.json --profile role-profile-name
Reserve Registry Request
curl -X POST localhost:3000/api/registry -d '
    {
        "username": "redone", 
        "password": "password", 
        "reserveDate": "2022-07-04T23:23:23Z", 
        "reserveCourt": "1", 
        "reserveTime": "21"
    }
'
Fetch Registry Request
curl -X GET localhost:3000/api/registry?id=xxxxxxx
Environment file

Environment json file format for local testing

{
    "ReserveRegistry": {
        "S3Bucket": "s3-bucket-name",
        "secretKey": "s3 byte hex value (32byte hex)"
    },
    "FetchRegistry": {
        "S3Bucket": "s3-bucket-name",
        "secretKey": "s3 byte hex value (32byte hex)"
    }
}

AWS ECS

Create .env file to store required variables

  • _AWS_REGION
  • _ENDPOINT_AWS_PROFILE
  • _APP_AWS_ROLE
  • _ENC_KEY
  • _S3_BUCKET
  • _DAAN_LOGIN
Testing with container and role

Execute docker compose for local testing

docker compose up -d

View outputs

docker compose logs [SERVICE]
Testing program execution

Build

go build -o loginCookie.out

Test

env $(cat .env | xargs) ./loginCookie.out -profile="aws profile name"

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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