Skip to content

DotNetRussell/Accio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Accio

Quickly summon a new web server

Accio can handle any request method type that you define as well as delays to simulate network latency. If you have wildcards in your url path for example /myPath/has/ID/152/page/endpoint/111 where 152 and 111 are wildcard paths then you can replace them in the config with {$} for example /myPath/has/ID/{$}/page/endpoint/{$}

Accio
Author: Athony Russell
Twitter: @DotNetRussell
Blog: https://DotNetRussell.com
GitHub: https://github.com/DotNetRussell

To Use:

python accio.py [config file path] [target localhost port] [calling port (For CORS)]

Example:

python accio.py /home/user/Desktop/accioConfig.json 8080 4200

Example Output:

Accio --% ~~~~ @X@ Server Active @X@
Server Listening On Port 8080
Press CTRL+C to stop the server

Example Config:

{
        "routes" : [
                {
                        "url" : "/endpoint1",
                        "definition" : {
                                "filePath" : "./examples/endpoint1.json",
                                "method" : "GET",
                                "delay" : 5
                        }
                },
                {
                        "url" : "/endpoint1",
                        "definition" : {
                                "filePath" : "./examples/endpoint1_post.json",
                                "method" : "POST",
                                "delay" : 2
                        }
                },
                {
                        "url" : "/endpoint2",
                        "definition" : {
                                "filePath" : "./examples/endpoint2.json"

                        }
                },
                {
                        "url" : "/endpointWithWildCard/{$}/somethingElse/{$}",
                        "definition" : {
                                "filePath" : "./examples/wildCard.json"

                        }
                }

        ]

}

About

Quickly summon a new web server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages