Skip to content

Latest commit

 

History

History
43 lines (30 loc) · 1.32 KB

README.md

File metadata and controls

43 lines (30 loc) · 1.32 KB

Go Server with Resource Watch API Integration

This server is written in Go and allows users to sign up and log in via the Resource Watch API. The server uses JWT for authentication and is built with the Gorilla Mux router, handling CORS configurations for cross-origin requests.

Features

  • Sign Up: Creates a new user on the Resource Watch platform.
  • Log In: Authenticates a user and generates a JWT token for session management.

Requirements

Setup

  1. Clone the repository and navigate to the project directory.

  2. Environment Variables: Create a copy of .env.example into a .env file in the project root to store environment variables. It should contain the following keys:

    PORT=":5003"
    APP_NAME=resource_watch_app_name
    PGREST_SECRET=your_jwt_secret_shared_with_postgREST
    CALLBACK_URL=website_url
    RW_API_KEY=resource_watch_API_key
    DATABASE_URI=postgresql://
    
  3. Install Dependencies:

    Run the following commands to install necessary dependencies.

    go get

Running

go run main.go