Coder Social home page Coder Social logo

messageboardservice's Introduction

Message Board Service

This is the repository for a Message Board Service

To run with maven execute: mvn spring-boot:run

To build with maven and then run. Execute:

  1. mvn clean package
  2. java -jar MessageBoardService-1.0.0-RELEASE.jar

The project also has a build script that can be executed to build and expose the service in a docker container. This builds the projec,deploys a container and exposes port 8080 in the container on port 80 on the docker host.

To execute the build script run: sh build.sh

To see the logs of the container run: docker logs -f {name_of_container}

Usage instructions

To use the service a valid JWT token will have to be provided as a bearer token in the authorization header. One of the following tokens can be used to authenticate against the service. The email at the end of each token is the user represented. Do NOT include the email when passing the token.

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhdXRoLmJqb3Jqb2guc2UiLCJpYXQiOjE1NTQ1NDU1OTQsImV4cCI6MTU4NjA4MTU5NCwiYXVkIjoibWVzc2FnZUJvYXJkLmJqb3Jqb2guc2UiLCJzdWIiOiJqb2huRG9lQGV4YW1wbGUuY29tIiwiR2l2ZW5OYW1lIjoiSm9obiIsIlN1cm5hbWUiOiJEb2UiLCJFbWFpbCI6ImpvaG5Eb2VAZXhhbXBsZS5jb20ifQ.zJNqbnp5drRdADn-BgbauC5XpzlvSSRkA8KVwrbuQ98 [email protected]

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhdXRoLmJqb3Jqb2guc2UiLCJpYXQiOjE1NTQ1NDU1OTQsImV4cCI6MTU4NjA4MTU5NCwiYXVkIjoibWVzc2FnZUJvYXJkLmJqb3Jqb2guc2UiLCJzdWIiOiJqYW5lRG9lQGV4YW1wbGUuY29tIiwiR2l2ZW5OYW1lIjoiSmFuZSIsIlN1cm5hbWUiOiJEb2UiLCJFbWFpbCI6ImphbmVEb2VAZXhhbXBsZS5jb20ifQ.gPCx0722ufOkDPwd5qTdqGRn5I9eaFXYGdfNYFm9DWc [email protected]

eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhdXRoLmJq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message":"hello"}' localhost:8080/messages/

Edit message

curl -X PUT -H "Content-Type:application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhdXRoLmJqb3Jqb2guc2UiLCJpYXQiOjE1NTQ1NDU1OTQsImV4cCI6MTU4NjA4MTU5NCwiYXVkIjoibWVzc2FnZUJvYXJkLmJqb3Jqb2guc2UiLCJzdWIiOiJqYW5lRG9lQGV4YW1wbGUuY29tIiwiR2l2ZW5OYW1lIjoiSmFuZSIsIlN1cm5hbWUiOiJEb2UiLCJFbWFpbCI6ImphbmVEb2VAZXhhbXBsZS5jb20ifQ.gPCx0722ufOkDPwd5qTdqGRn5I9eaFXYGdfNYFm9DWc" -d '{"message":"Another hello"}' localhost:8080/messages/acc529e0-1a32-446b-b3bd-6dc67413c8b9

Delete message

curl -X DELETE -H "Content-Type:application/json" -H "Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJhdXRoLmJqb3Jqb2guc2UiLCJpYXQiOjE1NTQ1NDU1OTQsImV4cCI6MTU4NjA4MTU5NCwiYXVkIjoibWVzc2FnZUJvYXJkLmJqb3Jqb2guc2UiLCJzdWIiOiJqYW5lRG9lQGV4YW1wbGUuY29tIiwiR2l2ZW5OYW1lIjoiSmFuZSIsIlN1cm5hbWUiOiJEb2UiLCJFbWFpbCI6ImphbmVEb2VAZXhhbXBsZS5jb20ifQ.gPCx0722ufOkDPwd5qTdqGRn5I9eaFXYGdfNYFm9DWc" localhost:8080/messages/acc529e0-1a32-446b-b3bd-6dc67413c8b9

Get messages

curl localhost:8080/messages/

messageboardservice's People

Contributors

bj0rj0h avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.