1.0.0-0 • Published 3 years ago

@plaqard/core v1.0.0-0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@plaqard/core

Build Status

Mock advertisement server. Useful when you want to simulate certain content responses.

Combine it with with Advertol for easier advertisement management!

By default Plaqard doesn’t apply any functionality but relies on plugins for service and zone. Read documentation for each plugin type to learn how to create your custom plugin.

Install

npm install @plaqard/core --save

Usage

import plaqard from '@plaqard/core';
import CustomService from './service';
import CustomZone from './zone';

const instance = plaqard({
	zones: [
		{
			id: 'becky',
			dimensions: {
				width: 300,
				height: 600
			},
			contentType: CustomZone
		}
	],
	service: new CustomService()
});

instance.start();

API

plaqard(options)

Returns: Plaqard

Create Plaqard instance.

zones

Type: object[]

List of zones.

PropertyTypeDescription
idstringZone ID.
dimensionsobject\|object[]Zone dimension or list of zone dimensions.
contentTypeZoneZone class for zone instance.
contentPathstringTemplate path for zone content.

service

Type: Service

Advertisement server service.

hostname

Type: string

Server hostname.

port

Type: number

Server port.

sslKey

Type: string

SSL key path for HTTPS server.

sslCert

Type: string

SSL certificate path for HTTPS server.

instance.start()

Returns: Promise

Start server instance.

instance.stop()

Returns: Promise

Stops server instance.

License

MIT © Ivan Nikolić