Code Monkey home page Code Monkey logo

thisandthat's Introduction

thisAndThat /document API

  1. Run a ./gradlew clean build
  2. Run the service either via ./gradlew bR, or however you start your Java applications. It will start on port 8080 by default.
  3. Test via postman, or your preferred method of testing APIs. The url is http://localhost:8080/document.
  4. Once running you can check available data by connecting to the h2 console. No password is needed, just hit connect.
  5. NOTE: Besides Springboot, this project uses Lombok to make writing getters and setters unnecessary, as well as adds slf4j for access to easy logging.

Adding a document

  1. Use a POST call to http://localhost:8080/document
  2. Use a JSON body. Sample:
{
	"id":1,
	"title":"Document Title",
	"content": "Any content you like."
}

Reading a document

  1. Use a GET call to http://localhost:8080/document/{documentId}
  2. No body is accepted. You can use an id from a created document, or use one of my precreated ones - 10, 20, 30. E.g. you can try localhost:8080/document/30 right at startup.

Assumptions Made

  1. Documents are json based with a title and content.
  2. No database persistence is required.
  3. Requirement of "allow(ing) many callers to read and write documents at the same time without issue." does not imply a need for hosting this. If hosted, there is no reason calls can't be made async.

thisandthat's People

Contributors

aoganezo avatar

Watchers

 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.