@plaqard/core

1.0.0-0 • Public • Published

@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.

Property Type Description
id string Zone ID.
dimensions object|object[] Zone dimension or list of zone dimensions.
contentType Zone Zone class for zone instance.
contentPath string Template 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ć

Package Sidebar

Install

npm i @plaqard/core

Weekly Downloads

1

Version

1.0.0-0

License

MIT

Unpacked Size

38.9 kB

Total Files

8

Last publish

Collaborators

  • niksy