Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@
- Install node and npm (in case if you haven't).
- Open terminal and navigate to the folder and execute below commands.
- `npm install`
- `mockserver -p 9000 -m mocks`
- `npx mockserver -p 9000 -m mocks` OR `npm start 9000`
- That should start a mock server and should show as below.
- Mockserver serving mocks {verbose:true} under `mocks` at `http://localhost:9000`
- change the port number in case if you are using `9000` for anything else.

# Now you can do following API calls:

- GET - `http://localhost:9000/goals` - gets all the goals
- OPTIONS - `http://localhost:9000/goals` - verifies the request by redirect.
- POST - `http://localhost:9000/goals` - creates a goal
- DELETE - `http://localhost:9000/goals` - deletes a goal
- DELETE - `http://localhost:9000/goals` - deletes a goal
9 changes: 9 additions & 0 deletions mocks/goals/OPTIONS.mock
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
HTTP/1.1 200 OK
content-encoding: gzip
transfer-encoding: chunked
access-control-allow-origin: *
access-control-allow-credentials: true
strict-transport-security: max-age=31536000; includeSubDomains
access-control-max-age: 3600
access-control-allow-headers: expires,origin,language,pragma,accept,last-modified,x-xsrf-token,x-requested-with,content-type,location,cache-control,content-language
access-control-allow-methods: POST, DELETE
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "1.0.0",
"description": "mockable APIs",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"start": "mockserver -m mocks -p "
},
"keywords": [
"mocker",
Expand Down