Skip to content

scherbatey/wiki_test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wiki_test

Setup

Run the following commands in psql shell:

create role wiki login password '123'; create database wiki owner wiki; create database wiki_test owner wiki;

Running tests

From project directory run: python3 -m unittest discover

Running application

From project directory run: python3 server.py The service listens port 8888

Usage examples

List of pages:

curl 127.0.0.1:8888/pages

Add new page:

curl 127.0.0.1:8888/page -d '{"text":"1v1","title":"p1"}' -H 'Content-Type: application/json'

Return page current version content:

curl 127.0.0.1:8888/page/1

or

curl 127.0.0.1:8888/page_by_title/p1

Return page version:

curl 127.0.0.1:8888/page/1/version/1

Add new page version:

curl 127.0.0.1:8888/page/1/version -d '{"text":"1v2","title":"p1"}' -H 'Content-Type: application/json'

Page versions:

curl 127.0.0.1:8888/page/1/version

Page current version number:

curl 127.0.0.1:8888/page/1/current_version

Change page current version:

curl 127.0.0.1:8888/page/1/current_version -d '{"version":2}' -H 'Content-Type: application/json'

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages