GithubHelp home page GithubHelp logo

mrrutledge / springapp Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 21 KB

API to encourage potential voters to register and pledge to vote. The API is built using Spring boot framework and gradle.

License: MIT License

Java 100.00%
pledge vote springboot api java beginner-project

springapp's Introduction

SpringApp API

API to encourage potential voters to register and pledge to vote. The API is built using Spring boot framework and gradle. Clone the repo and play with it to see how it works, run it in your favorite IDE, test it with the requests below.

Tools

SpringBoot: 1.5.10.
Gradle: 5.0
Java: 8

Get and Post requests to try out in your bash terminal

Read Hello

curl -i -H "Content-Type: application/json" -X GET localhost:8080/hello

Add new pledge

curl -i -H "Content-Type: application/json" -X POST -d '{
    "name": "Random Guy",
     "statement": "I vote to change the world!"
     }' localhost:8080/pledges

Add new pledge

 curl -i -H "Content-Type: application/json" -X POST -d '{
     "name": "Honest Hill",
      "statement": "I vote to the system !"
      }' localhost:8080/pledges

List all pledges

curl -i -H "Content-Type: application/json" \
    -X GET localhost:8080/pledges

Get one Pledge

curl -i -H "Content-Type: application/json" \
    -X GET localhost:8080/pledges/2

Change one pledge

curl -i -H "Content-Type: application/json" -X POST -d '{
        "name": "Little Pray",
        "statement": "I vote for the future!"
    }' localhost:8080/pledges/2

Possible usage

We can build a web app with similar functionality, just add a UI with a bit more functions and we get ourselves an app.

Reference: Dr. B Fraser, Spring with Intellij.

springapp's People

Contributors

mrrutledge avatar

Stargazers

 avatar

Watchers

 avatar  avatar

springapp's Issues

Code cleanup

Hi there!

It is my intention to start contributing on some open source projects, but since I've not done this before and stumbled upon yours I hoped I could help you a bit ๐Ÿ˜„.

I would like to do some code cleanup and add some unit tests for your controller. I first want to do the cleanup and create a PR for that.

The cleanup is mainly about moving the MakeSpringPrettyPrintJSON to a different package, since it's no controller. I'd also like to create a separate controller for the /hello call which would mean that we can use a @RequestMapping("pledges") to clean that part a bit up as well.

Let me know!

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.