- An application that allows users to create, share, and access code on the web. Code snippets are stored in the database and deleted if they have a time and/or views restriction that is met. The project is a RESTful API and WebInterface and is an implementation of the Code Sharing Platform project from hyperskill.org
Api endpoints are the following:
-
POST /api/code/new: upload a new code snippet given a JSON object request body that contains the code snippet, time restriction (optional), and views restriction (optional).{ "code" : "code_snippet", "time" : "100", "views" : "99" }Returns the generated unique id of the code snippet:
{ "id": "38cd7699-1380-40f6-93ce-b30016f5a48c" } -
GET /api/code/{id}return JSON of the code snippet given its id:{ "code": "code_snippet", "date": "2022-04-05 11:59:46", "time": 55, "views": 98 } -
GET /api/code/latestreturn the JSON array of the 10 most recently uploaded code snippets, ordered from newest to oldest, that have no view and/or time limit :
Web endpoints are the following:
/code/newreturn html page,that contains a text area for users to add a new code snippet, along with inputs for time and views restriction (optional):
/code/latest: return a dynamic page of the 10 most recently loaded code snippets, ordered from newest to oldest, that have no view and/or time limits:
/api/code/{id}return HTML that contains the code snippet (and restrictions, if applicable) given its id:


