Skip to content

Latest commit

 

History

History
64 lines (49 loc) · 1.9 KB

File metadata and controls

64 lines (49 loc) · 1.9 KB

pink-spring

Checklist

What is SpringBoot?

Spring Boot is a mature, open-source, feature-rich framework.

Generate this project

Generate this initial project with start.spring.io

Basic

After follow: https://spring.io/guides/gs/rest-service/#scratch

Reference code

https://github.com/spring-guides/gs-rest-service/tree/master/complete

Encrypt or decrypt messages API

Let's make this more exciting! Implement one of the algorithms below!

Simple - Caesar cipher

https://en.wikipedia.org/wiki/Caesar_cipher

Medium - Simple Substitution cipher

https://en.wikipedia.org/wiki/Substitution_cipher

More on classical ciphers

https://en.wikipedia.org/wiki/Classical_cipher

Links

http://localhost:8080/greeting http://localhost:8080/greeting?name=Kate http://localhost:8080/cesar?offset=3&text=this%20is%20a%20test

Commands used

Package your jar

mvn package

Run the app

java -jar target/crypto-0.0.1-SNAPSHOT.jar

curl commands for post varsion

  • encode
curl -i \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"text": "this is a test", "offset": 3}' "http://localhost:8080/cesar/encode"
  • decode
curl -i \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"text": "wklv lv d whvw", "offset": 3}' "http://localhost:8080/cesar/decode"