GithubHelp home page GithubHelp logo

hngi-team-sentry-backend-task's Introduction

Team -Sentry Backend task with PHP

Welcome to the static page generator API created by the PHP people of team-sentry.
This api will enable you create static pages (markdown and html) , store them for you and you can have them anytime.

All the urls return responses in json format, like so;

{
    'message':
        "response payload here"
}

How to use it

The api uses four major endpoints as explained below.
All request are sent to;

http://server-url/api/

To upload a markdowm file

To upload a markdown file, send a POST request to;

http://server-url/api/add_page?file=file-here

If you dont have a markdown file we can create one for you by specifying a file titile and it's contents like so;

http://server-url/api/add_page?page_title=page-title-here&page_content=page-content-here

We shall create the file for you and keep for you.

To write to a file

If you have a file with us already, send a POST request to this endpoint specifying the title and the content you want to write and it shall be done;

http://server-url/api/set_page_markdown?page_title=page-title-here&page_content=page-content-here

To get html

To get the html equivalent of your markdown file, send a GET request to this endpoint to get your html. The page title must be set.

http://server-url/api/retrieve_page_html?page_title=page-title-here

To get markdown

To get the markdown text, send a GET request to this endpoint. The page title must be set.

http://server-url/api/retrieve_page_markdown?page_title=page-title-here

To get a list of pages stored with us

Send a GET request to this endpoint to get a list of all the pages you have stored with us;

http://server-url/api/list_pages

Errors

If any of the responses are not successful, it means there was problem and it will be indicated in the errors key of the json response, like so;

{
    'errors':
        "error response here"
}

hngi-team-sentry-backend-task's People

Contributors

damivik avatar onwuagba avatar saidiali 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.