Created
May 14, 2022 05:13
-
-
Save tamirazrab/cf3b54444b7561006e1152774bd69211 to your computer and use it in GitHub Desktop.
Hapi POST request test.
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
| 'use strict' | |
| const Hapi = require('hapi') | |
| const Boom = require('boom') | |
| const init = async () => { | |
| const server = Hapi.server({ | |
| port: 3000, | |
| host: 'localhost' | |
| }) | |
| server.route({ | |
| method: ['GET', 'PUT', 'POST'], | |
| path: '/', | |
| handler: function (request, h) { | |
| return 'I did something!' | |
| } | |
| }) | |
| await server.start() | |
| console.log('Server running on %s', server.info.uri) | |
| } | |
| init() |
Author
tamirazrab
commented
May 14, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment