db-init
flag. The rest of the command line options that might be useful for testing are listed below.dist/curl/tokens.sh
, start the server with the gen-tokens
flagcurl
requests in the corresponding folderstack test
1234_migration_name.sql
format and in strict order, starting at 0000_migration_name.sql
;drop.sql
file is used to drop tables;For migrations test:
db-init
command,migrations
command
db-init
- applying migrations to the local database, starting with zero migrationmigrations
- applying migrations to the local database, starting with the first not applied migration(the one that is not in the migrations database table)db-drop
- drop all database tablesdb-restart
– db-drop
+ db-init
db-restart-force
- force db-restart
gen-tokens
- update token file dist/curl/tokens.sh
The server operation logic is divided into the following layers (presented in the corresponding folders in the src
) from low to high:
Lower layers should not import modules from higher layers.
The server supports the following api functions (paths). Some paths are available only for admin (marked with ). In this case, other users receive an Unknown path
error. Some paths are available only for authorized users () or for all users (). For testing each path, there is a separate file in the curl
folder. The requests in the file are duplicated for different tokens (users). The posts
request is tested with different filters.
All possible paths are written in the Logic.Pure.API.router
function. All possible parameters for each path are written in theLogic.Pure.Params.Internal.possibleParamDescs
function. All requests for creating, editing, deleting entities and uploading photos return the number of changed entities.
/login
- login/photos/upload
- upload photo, for all;photos/fileName
- download photo by fileName
;photos
- returns list of photos filenames; users/create
- create a user;authors/create
- create an author;categories/create
- create a category;tags/create
- create a tag;drafts/create
- create a draft;drafts/n/publish
- publish a draft (delete draft and create post);posts/n/comments/create
- create a comment to a post with id = n
; users/n/edit
- edit user with id = n
;user/edit
- edit current user;authors/n/edit
- edit author with id = n
;categories/n/edit
- edit category with id = n
;tags/n/edit
- edit tag with id = n
;drafts/n/edit
- edit draft with id = n
;posts/n/edit
- edit post with id = n
; users/n/delete
- delete user with id = n
;authors/n/delete
- delete author with id = n
;categories/n/delete
- delete category with id = n
;tags/n/delete
- delete tag with id = n
;drafts/n/delete
- delete draft with id = n
;posts/n/delete
- delete post with id = n
;comments/n/delete
- delete comment with id = n
; users
- select many users with pagination;authors
- select many authors with pagination;categories
- select many categories with pagination;tags
- select many tags with pagination;posts
- select many posts with pagination and filters;drafts
- select many drafts with pagination;posts/n/comments
- select many comments with pagination for post with id = n
; users/n
- select user with id = n
;user
- select current user;authors/n
- select author with id = n
;categories/n
- select category with id = n
;tags/n
- select tag with id = n
;posts/n
- select post with id = n
;drafts/n
- select draft with id = n
.