Go RSS feed aggregator authenticated with API keys
git clone https://github.com/clxrityy/gorssagg.git
go mod vendor && go mod tidy
go build && ./gorssagg
PORT=8080
DB_URL=postgres://postgres:@localhost:5432/gorssagg?sslmode=disable
/v1
- base route
import (
//...
"github.com/go-chi/chi"
"github.com/go-chi/cors"
//...
)
//...
func main() {
//...
router := chi.NewRouter();
router.Use(cors.Handler(cors.Options{
//...
}))
v1Router := chi.NewRouter();
router.Mount("v1", v1Router);
}
-
- POST - creates a user, takes a
name
parameter- responds with a JSON object that should contain the user's
api_key
- responds with a JSON object that should contain the user's
- GET - get a user by their API key
- pass in the
Authorization: ApiKey <api_key>
header
- pass in the
- POST - creates a user, takes a
-
- POST - creates a feed, takes a
name
&url
parameter (the URL should point to some sort of/index.xml
)- responds with
201
if successful - pass in the
Authorization: ApiKey <api_key>
header
- responds with
- GET - returns an array of feeds (no parameters)
- POST - creates a feed, takes a
-
- POST - follows a feed, takes a
feed_id
parameter- pass in the
Authorization: ApiKey <api_key>
header - responds with
201
if successful
- pass in the
- GET - gets the feed(s) a user is following
- pass in the
Authorization: ApiKey <api_key>
header
- pass in the
- DELETE -
/v1/feed_follows/{feed_follow_id}
- unfollow a feed- pass in the
Authorization: ApiKey <api_key>
header
- pass in the
- POST - follows a feed, takes a