This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Hapi = require('@hapi/hapi'); | |
| const users = [ | |
| { id: 1, name: 'Siva' }, | |
| { id: 2, name: 'Sivasankar' }, | |
| { id: 3, name: 'Niralar' } | |
| ] | |
| const server = Hapi.server({ | |
| port: 3000, | |
| host: 'localhost' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const server = require('./server.js'); // Import Server/Application | |
| // Start application before running the test case | |
| beforeAll((done) => { | |
| server.events.on('start', () => { | |
| done(); | |
| }); | |
| }); | |
| // Stop application after running the test case |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = require('request'); | |
| const API_KEY = 'xxx'; | |
| const body = { | |
| 'dynamicLinkInfo': { | |
| 'domainUriPrefix': 'https://niralar.page.link', | |
| 'link': 'http://niralar.com/building-rest-apis-with-swagger-on-node-js/' | |
| } | |
| } | |
| request({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const request = require('request'); | |
| const API_KEY = 'xxx'; | |
| const body = { | |
| 'longDynamicLink': 'https://niralar.page.link/?link=http://niralar.com/building-rest-apis-with-swagger-on-node-js/' | |
| } | |
| request({ | |
| url: `https://firebasedynamiclinks.googleapis.com/v1/shortLinks?key=${API_KEY}`, | |
| method: 'POST', json: true, body | |
| }, function (error, response) { |
OlderNewer