Skip to content

fdu14ss/server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#README a simple server based on flask

##API according to the requirements, this server does not conform to REST exactly but uses verbs in part of its urls.

###/login

  • POST

     {"username": "user",
     "password": "pw" }

    return:

     成功:
     	{
     		"status": true
     	}
     
     	or
     	
     	
     失败:
     	{
     		"status": false,
     		"cause": "the reason or cause of this failure"
     	}
    

###/logout

  • GET

     未登录:
     	{
     		"status": false,
      		"cause": "unauthorized"
      	}
      	
      	or
      	
      	
     已登录:
     	{
     		"status": true
     	}

###/register

  • POST

    create a new user

     {"username": "user",
     "password": "pw" }

    return:

     	{
     		"status": false, 
     		"cause": "username already exists"
     	}
     	
     	or
     	
     	{
     		"status": true
     	}

###/users/username/projects/pj_id

ATTENTION: POST and DELETE require login. Otherwise the server returns

{
	"status": false, 
	"cause": "unauthroized"
}
  • POST

    what this route cares about is the uploaded file. any file will be saved to replace the former file in this project

    if the project with the pj_id does not exist yet, then it will be created and your file will be saved too.

    return:

     	{
     		"status": false, 
     		"cause": "cause"
     	}
     	
     	or
     	
     	{
     		"status": true
     	}
  • DELETE

    the whole project folder will be deleted from the server.

     	{
     		"status": false, 
     		"cause": "cause"
     	}
     	
     	or
     	
     	{
     		"status": true
    

###/users/username/projects/pj_id/share

  • GET

    return the cover html for corresponding project. use this to share the project.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published