8000 GitHub - itterheim/Web-API-Definition: Definition of mock web API server using custom .wad file
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

itterheim/Web-API-Definition

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Web API Definition

Definition of mock web API server using custom .wad file

.wad definition file

.wad file contains definiton of your API

-port 3000

GET "/api/hello"
-response
    {"message": "hello"}

GET "/api/world"
-response "world"

What this example does?

  1. Creates localhost http server on port 3000
  2. Creates HTTP GET enpoint /api/hello which returns application/json data
{
    "message": "hello"
}
  1. Creates HTTP GET endpoint /api/world which returns string world as text/plain
  2. Responds to every other request with 404 page not found

Run .wad file

Build and run

  1. go build contents of ./scr
  2. place builded executable file in same folder as your.wad file
  3. ... execute

Windows

  1. place ./wad.exe in same folder as your.wad file
  2. ... execute

About

Definition of mock web API server using custom .wad file

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

0