RSS reader service API, built with Java 8, Jetty, JAX-RS (Jersey), Google Guice and MySQL.
- Java 8
- Maven 3
- MySQL
List subscriptions.
Response:
200 OK
[
{
"id": 1,
"url": "https://feeds.a.dj.com/rss/RSSOpinion.xml",
"feed": {
"title": "RSSOpinion",
"description": "RSSOpinion",
"entries": [
{
"title": "Trump's Misguided Sw",
"link": "https://www.wsj.com/articles/trumps-misguided-swipe-at-bill-barr-11602449244",
"description": "The AG isn’t helped by public badgering from the Oval Office."
}
]
}
}
]
Get subscription.
Response:
200 OK
{
"id": 1,
"url": "https://feeds.a.dj.com/rss/RSSOpinion.xml",
"feed": {
"title": "RSSOpinion",
"description": "RSSOpinion",
"entries": [
{
"title": "Trump's Misguided Sw",
"link": "https://www.wsj.com/articles/trumps-misguided-swipe-at-bill-barr-11602449244",
"description": "The AG isn’t helped by public badgering from the Oval Office."
}
]
}
}
Subscribe feed. Any RSS feed URL should work, for example, these URLs are available in The Wall Street Journal.
Request:
{
"url": "https://feeds.a.dj.com/rss/RSSOpinion.xml"
}
Response:
201 Created
Unsubscribe feed.
204 No Content
In this repository, we have a Docker Compose file (docker-compose.yml
) to create and start MySQL service locally.
docker-compose up -d
mvn package
java -cp "target/classes:target/dependency/*" "com.tatsuyaoiw.rssreader.Main"
This is how we start Jetty on Heroku. You can check the actual command in the Procfile
.
Note: With Heroku, this application requires the JawsDB MySQL add-on installed as the MySQL data source.
heroku login
heroku create
git push heroku master
heroku open
- Write unit tests for repositories