This project provides a backend API for a Chrome extension. The API is built using Go and provides endpoints to handle requests from the Chrome extension.
This endpoint handles incoming requests from the Chrome extension.
Request Example:
curl -X POST http://localhost:8080/api/v1/requests -H "Content-Type: application/json" -d '{"link": "https://google.com"}'
Response Example:
{
"html": ""
}
This endpoint handles preflight requests for CORS.
Request Example:
curl -X OPTIONS http://localhost:8080/api/v1/requests
Response Example:
HTTP/1.1 200 OK
Allow: OPTIONS, POST
To run the API using Docker Compose, follow these steps:
- Build and run the Docker container:
docker compose up --build
- Access the API:
The API will be available at http://localhost:8080
.
app/
: Contains the application code.app/controllers/
: Contains the controllers for handling API requests.app/controllers/api/v1/
: Contains the version 1 API controllers.main.go
: The entry point of the application.go.mod
: The Go module file.go.sum
: The Go dependencies file.Dockerfile
: The Dockerfile for building the Docker image.docker compose.yml
: The Docker Compose file for managing the Docker container.
PORT
: The port on which the HTTP server will run. Default is8080
.
This project is licensed under the MIT License.