Skip to content

JJaraM/blog-microservice-post

Repository files navigation

Post Web Service

A web service using webflux to store the personal post from the blog site

View Demo · Report Bug · Request Feature

English · Español

Deploy

Deploy to Heroku

Configuration

To run the application you will need to configure the following environment properties:

  • MONGODB_URI
  • REDIS_URI
  • REDIS_CHANNEL_TAG
  • MONGODB_NAME
  • AUTHORIZATION_SERVER

How to run in Postman?

To run an example of the api you need to enter to postman and run the following operation as GET

https://blog-microservice-api-gateway.herokuapp.com/post/0/10/0

Then go to Authorization tab and select OAuth2.0 as the type, next to there is a button called Get New Access Token enter the following data.

Token Name: Blog Token name (optional)
Gran Type: Password Credentials
Access Token URL: https://blog-microservice-oauth-server.herokuapp.com/auth/realms/blog/protocol/openid-connect/token
Username: mike@other.com
Password: pass
Client ID: newClient
Client Secret: newClientSecret
Scope: read
Client Authentication: Send as Basic Auth header

How to run in Docker?

To run in docker you need to run the following commands:

  • mvn clean package
  • sudo docker run -d -p 8080:8080 -v properties.yml spring-boot:1.0

The properies.yml will contains the environment variables like:

How to run maven

mvn install -DskipTests=true -Dmaven.javadoc.skip=true -B -V
MONGODB_URI:
REDIS_CHANNEL_TAG:
REDIS_URL:
MONGODB_NAME: 
AUTHORIZATION_SERVER:

How to run locally

IntelliJ

  • Go to your run/debug configuration and add the following configuration in the program arguments:

--spring.profiles.active=dev

About

This is a web service that is used to feed my personal web site, and it's showing the post information.

Technology Stack

  • Spring Web Flux
  • Eureka Service Discovery
  • Reactive API
  • MongoDB
  • Lombok
  • Redis
  • Lettuce