LolCatz Backend
Manage funny cat pictures. Or any other kind of pictures, really.
Build
go build -o bin/server .
Usage
- Build the server binary
- Create an S3 bucket and set up credentials via the default AWS credentials chain
- Start the frontend (take note of the browser URL for the CORS origin header)
- Note: you may omit
-cors-allow-origin
but this is recommended only for development purposes
- Start the server:
bin/server -bucket <bucket> -region <region> -cors-allow-origin http://localhost:3000
Database Config
Default database config assumes postgres on localhost:5432
, database lolcatz
, password default
. To customize:
bin/server -bucket <bucket> -region <region>
-db-host <my-db-hostname>
-db-user <my-db-user>
-db-password <my-db-password>
-db-name <my-db-name>
Change HTTP Port
By default the http server will bind to localhost:8000
which is suitable for development. To customize, use the -bind
option.
bin/server -bind=localhost:9000 ...