An open API service indexing awesome lists of open source software.

https://github.com/dotnetrussell/accio

Quickly summon a new web server
https://github.com/dotnetrussell/accio

Last synced: over 1 year ago
JSON representation

Quickly summon a new web server

Awesome Lists containing this project

README

          

# 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"

}
}

]

}

```