You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
Html Archive (HAR) - is a modern way to snapshot webpage loading. Web browser can produce those files in several clicks.
Describe the solution you'd like
HAR (Html Archive) is JSON file that contains recorded by dev tools networks calls. So all we have to build around it is a way to extract collection, routes and connect it to the mock server.
Will be also great to support Zipped HAR files, they are quite huge in size, can easily reach 30-40Mb in size, and this is not optimal for git repos.
Describe alternatives you've considered
can be composed utilities that can convert HAR json to set of files: collection, routes, etc.
will be great to have Capture/Update functionality for proxy mode, when mocks-server record all requests/responses for reuse
# usage# now its time to convert HAR to set of JSON files
mocks/scripts/export.har.ts ./mocks/fixtures/16b19ff8-640f-4489-af03-9adff0e902da/recorded.har
Design points:
CLI tool that generates mock server configuration files from HAR
Known issues:
some kind of specifics to endpoints routes exists in a script, will be required small modifications for each business
not implemented yet a good parameters hashing logic (required for detecting change of parameters order in query path or query body)
export:har processing file: './mocks/fixtures/16b19ff8-640f-4489-af03-9adff0e902da/recorded.har' +0ms
export:har include failed entries: true +1ms
export:har enabled debug info: false +0ms
export:har total HAR entries: 133 +198ms
export:har source url: https://example.com/server +1ms
export:har "application/json" entries: 85 +1ms
export:har searching for unique entries... +0ms
export:har detected repeated entries: 37 +9ms
export:har mapped entries: 48 +24ms
export:har output mapping file: "./mocks/fixtures/16b19ff8-640f-4489-af03-9adff0e902da/mapping.json" +0ms
./mocks/scripts/export.har.ts --help
export.har.ts <file>
Converts a HAR (Html ARchive) file to a collection of JSON files
Options:
--file HAR file to convert [string] [required]
--failed extract failed entries [boolean] [default: true]
--debug enable debug logs [boolean] [default: false]
--version Show version number [boolean]
--help Show help [boolean]
extras (React Project Setup with Proxy and MockServer's):
Is your feature request related to a problem? Please describe.
Html Archive (HAR) - is a modern way to snapshot webpage loading. Web browser can produce those files in several clicks.
Describe the solution you'd like
HAR (Html Archive) is JSON file that contains recorded by dev tools networks calls. So all we have to build around it is a way to extract collection, routes and connect it to the mock server.
Will be also great to support Zipped HAR files, they are quite huge in size, can easily reach 30-40Mb in size, and this is not optimal for git repos.
Describe alternatives you've considered
Additional context
The text was updated successfully, but these errors were encountered: