Mock Data Server Prototype against a real API server with mock data

Covalent Quickstart includes the ultimate prototyping tool, a localhost Mock API!

With the mock API server, you can develop against realistic API service endpoints, and model the mock data closely to your production data!

The mock api server is called Covalent Data and is available as an npm package .

Covalent Quickstart integrates Covalent Data in its installation, so no additional steps are required to use it. In the covalent quickstart directory, simply run:

npm run start-api

You should see the server running starting with:

INFO[0000] ################################################################## INFO[0000] ######## ######## INFO[0000] ######## Teradata Covalent Atomic Data mock API server ######## INFO[0000] ######## Copyright 2016 by Teradata. All rights reserved. ######## INFO[0000] ######## This software is covered under the MIT license. ######## INFO[0000] ######## ######## INFO[0000] ##################################################################

The server is running as a background process so it's still possible to use the terminal for other commands. To stop covalent data, type:

npm run stop-api

Customizing Mock Data Schema

You can easily modify or create new schemas for mock data in the /mock-api/schemas/ directory.

For example to modify the mock users , edit mock-api/schemas/users.yaml

# this is a sample schema file for a user object. --- initial_entries: 10 randomize: false displayname: _firstname_ _lastname_ id: _firstname_._lastname_ email: _firstname_._lastname_@_company_.com created: _createdtimestamp_ last_access: _itemtimestamp_ site_admin: _admin_ ...

Modifying Mock Data

Dynamic data is wrapped in _underscores_ that match up to text files in /mock-api/datum/ .

For example the _firstname_ in the yaml above just looks for /mock-api/datum/firstname.txt , and each value is on a single line:

Aaron Benjamin Carl Olive ...

Consuming Mock Data Endpoints

The Mock API Server generates real endpoints that can be consumed in Angular services.

{{ mockApiDataTypescript }}

The Covalent Data Mock API Server actually stores data in memory, so it's possible to add, update, and delete records. All changes made will be erased once Covalent Data is stopped. See the Covalent Data repo for more information.

Quickstart Repo Data Repo