1.0.15 • Published 4 years ago

dyna-tiny-url-service v1.0.15

Weekly downloads
2
License
MIT
Repository
-
Last release
4 years ago

Dyna Tiny Url Service

Dyna Node Service that makes a URL tiny using the tinyurl.com api.

Usage example

    // our server
    const server = new DynaNodeServer({
      addresses: {
        internal: 'n/localhost/57206',
        external: 'n/localhost/57206',
      },
      connectionIds: {
        'dyna-tiny-url': {
          encryptionKey: 'encryptionKey',
          accessKey: 'accessKey',
        },
      },
    });
    await server.start();

    // This is our Tiny URL Service
    const service = new DynaTinyUrlService({
      name: "Dyna Tiny URL Service",
      serverDynaNodeAddress: 'n/localhost/57206',
      serviceConnectionId: 'dyna-tiny-url',
      encryptionKey: 'encryptionKey',
      accessKey: 'accessKey',
    });
    await service.start();

    // Our Client
    const client = new DynaNodeClient();

    // Let's ask it!
    client.sendReceive<null, ICOMMAND_TinyURL_Get_Data, null, ICOMMAND_TinyURL_Response_Data>({
      to: 'dyna-tiny-url@n/localhost/57206',
      command: COMMAND_TinyURL_Get,
      args: null,
      data: {
        url: 'http://www.anel.co/example/long/path/long/path/long/path/long/path/long/path/long/path/long/path/long/path',
      }
    })
      .then(reply => {
        console.log('shorten url:', reply.data.tinyUrl);
        console.log('qr barcode:', reply.data.qrBarcode);
      });

See it in action running the test of this package.

1.0.15

4 years ago

1.0.14

4 years ago

1.0.13

4 years ago

1.0.11

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago