Skip to content

Fulkin/code-sharing-platform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Code Sharing Platform

  • 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

About

Api endpoints are the following:

  1. 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"
    }
  2. 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
    }
  3. GET /api/code/latest return 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:

  1. /code/new return html page,that contains a text area for users to add a new code snippet, along with inputs for time and views restriction (optional):

Alt text

  1. /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:

Alt text

  1. /api/code/{id} return HTML that contains the code snippet (and restrictions, if applicable) given its id:

Alt text

About

Implementation of the Code Sharing Platform project from Hyperskill

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published