GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing hapi.dev — hapi.dev - Getting Started Getting Started This tutorial is compatible with hapi v17 and newer Overview This tutorial will show how to set up a basic hapi server that displays "Hello World!" in your browser. Installing hapi Create a new directory
Creating a Server A very basic hapi server looks like the following: js 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 First, you require hapi. Then you initialize a new When creating a server, you can provide a hostname, IP address, a Unix socket file, or Windows named pipe to bind the server to. For more details, see the API reference. The Adding Routes After you get the server up and running, its time to add a route that will display "Hello World!" in your browser. js 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Save the above as The The The Everything Else hapi has many, many other capabilities and only a select few are documented in tutorials here. This tutorial was intentionally minimal, we highly recommend you to check out the plugins tutorial. It will give some more knowledge to better organize your hapi project. We also have other tutorials of interest, please use the list to your left to check them out. Everything else is documented in the API reference and, as always, feel free to ask questions on github or just visit us on slack. |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |