@plaqard/core
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ć