Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aneldev/dyna-tiny-url-service
Dyna Node Service for Tiny URLs
https://github.com/aneldev/dyna-tiny-url-service
Last synced: 1 day ago
JSON representation
Dyna Node Service for Tiny URLs
- Host: GitHub
- URL: https://github.com/aneldev/dyna-tiny-url-service
- Owner: aneldev
- License: mit
- Created: 2019-05-11T16:27:38.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-12-10T17:22:09.000Z (almost 2 years ago)
- Last Synced: 2024-10-05T15:47:15.682Z (about 1 month ago)
- Language: JavaScript
- Size: 936 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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({
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.