Skip to content

rbiodies/Code_Sharing_Platform

Repository files navigation

Code_Sharing_Platform

The objective of this project is to store all the code snippets that have been uploaded to the program.

Examples

Example 1: a POST /api/code/new requests with the body

ID is the unique number of the snippet that helps you access it via the endpoint GET /code/N.

Example 2: a GET /api/code/1 request with the correct id

Example 3: a GET /api/code/2 request with the correct id

Example 4: a GET /api/code/3 request, a wrong id number

Example 5: a GET /api/code/latest request

Return a JSON array with 10 most recently uploaded code snippets sorted from the newest to the oldest.

Example 6: a GET /code/latest request

Use the following dependency in the build.gradle file to be able to use FreeMarker:

implementation 'org.springframework.boot:spring-boot-starter-freemarker'

Apache FreeMarker™ is a template engine: a Java library to generate text output (HTML web pages, e-mails, configuration files, source code, etc.).

Example 7: a GET /code/new request

Example 8: a GET /code/latest request