Skip to content
This repository has been archived by the owner on Aug 26, 2024. It is now read-only.

castyapp/api.server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Casty API Server

This is a backend API server of Casty project written in go!

Postman API Documentation

You can find API Documentations on Postman

Requirements

Run Docker Container

$ docker run -p 9002:9002 castyapp/api:latest

docker-compose example

version: '3'

services:
  api:
    image: castyapp/api:latest
    ports:
      - 9002:9002
    args: ['--config-file', '/config/config.hcl']
    volumes:
      - $PWD/config.hcl:/config/config.hcl

Clone the project

$ git clone https://github.com/castyapp/api.server.git

Configuraition

There is a example.config.hcl file that you should make a copy of, and call it config.hcl in your work directory.

$ cp example.config.hcl config.hcl

Configure grpc client

You can find more information about how to run grpc server is available here [https://github.com/castyapp/grpc.server#readme]

grpc {
  host = "localhost"
  port = 55283
}

S3 bucket setup

You can configure the s3 bucket with these configurations This works with minio too

s3 {
  endpoint             = "127.0.0.1:9000"
  access_key           = "secret-access-key"
  secret_key           = "secret-key"
  use_https            = true
  insecure_skip_verify = true
}

Recaptcha setup

recaptcha.secret is a secret key that you get on hcaptcha admin console!

recaptcha.type is only available for hcaptcha, google will add soon!

recaptcha {
  enabled = false
  type    = "hcaptcha"
  secret  = "hcaptcha-secret-token"
}

You're ready to Go!

Run project with go compiler

You can simply run the project with following command

$ go run server.go

or if you're considering building the project

$ go build -o server .

or Build/Run the docker image

$ docker build . --tag=casty.api

$ docker run -dp --restart=always 9002:9002 casty.api

Contributing

Thank you for considering contributing to this project!

License

Casty is an open-source software licensed under the MIT license.