API Stubs
This tool has been designed to enable you stubbing of your server to quickly test your application with any response type and different variations of the data your servers deliver.
Dev app
To make use of NgOP API-Stubs you will have to initialise and run NgOP's dev app created for your application.
Follow getting started section if you stil haven't generated NgOP's dev app and then continue here.
Interface files / OpenAPI
This tool requires you to have your APIs described with an OpenAPI specification in YAML format.
Having them ready you will need to add their relative paths to your ngop.json, like this:
Currently remote files via URL are not supported.
{
"serverApis": [
"./path/to/your/open-api-file-1.yaml",
"./path/to/your/open-api-file-2.yaml"
]
}
Go to configuration section to learn more.
Creating Stubs
NgOP will automatically create stubs for all detected endpoints from your OpenAPI files at the dev app's start.
See how to start dev app if you don't know yet.
After dev app start, you will be able to go to http://localhost:PORT/ (where PORT is the number you defined by ngop run) and see all generated API stubs. There you will also be able to modify them and make your endpoints return different response statuses.
Running application with generated stubs
To make use of generated stubs you have to start an Angular project generated during dev app's initialisation:
npx ng serve ngop-dev-app-for-<<your_project_name>>
See more here.