Code Monkey home page Code Monkey logo

notes-api's Introduction

Notes Management Tool โ€“ REST-API

Yii

The REST-API for the Notes Management Tool.

Note: This is the API only. You need the appropriate client which is hosted at https://github.com/tbreuss/notes-client.

Install

git clone https://github.com/tbreuss/notes-api.git
cd notes-api
composer install

Create/import database

Create a database at your hosting provider and import config\mysql-dump.sql.

Config

Copy configuration files:

cd config
cp db.dist.php db.php
cp params.dist.php params.php

Edit both files according to your config settings.

Run

cd notes-server
php yii serve -p 8888

Open your webbrowser http://localhost:8888/

You should see:

<response>
    <title>REST-API for Notes Management Tool</title>
    <info>You need an appropriate client to access this API</info>
    <github>https://github.com/tbreuss/notes-client</github>
    <url>https://notes.tebe.ch</url>
</response>

Build

composer build

Build a zip archive for production. Needs globally installed git and composer and an existing config/prod.env.php.

Endpoints

To be done.

GET v1/ping

POST v1/login

GET v1/articles/id:\d+

PUT v1/articles/id:\d+

DELETE v1/articles/id:\d+

GET v1/articles

POST v1/articles

GET v1/articles/latest

GET v1/articles/liked

GET v1/articles/modified

GET v1/articles/popular

POST v1/articles/upload

GET v1/users/id:\d+

GET v1/users

GET v1/tags/id:\d+

GET v1/tags

GET v1/tags/selected

cURL calls

To be done.

Post login

curl -i --header "Content-Type: application/json" --request POST --data '{"username":"xyz","password":"xyz"}' http://localhost:8888/v1/login
curl -i --header "Content-Type: application/json" --request OPTIONS --data '{"username":"xyz","password":"xyz"}' http://localhost:8888/v1/login
curl -i -X OPTIONS http://localhost:8888/ --header "Content-Type: application/json"

notes-api's People

Contributors

tbreuss avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

prithviraj2511

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.