# Introduction to Restify
# 1. Discussion about Restify
- Faster than express
- DATP does not replace the API framework
# 2. Start Visual Studio Code
mkdir -p ~/DATP-training
cd ~/DATP-training
code .
1
2
3
2
3
Create a folder named myProject
, and in that folder create index.js
containing the example code from the Restify Quick Start guide at http://restify.com/docs/home/.
# 3. Build and run the Restify server
Open a terminal inside VSCode, using <control>-<shift>-` and test the Restify server.
npm init (accept the defaults)
npm install restify
node index.js
1
2
3
2
3
# 4. Test with curl
Open another terminal and test using the curl
command line utility.
curl -is http://localhost:8080/hello/chuck
-> hello chuck
curl -is http://localhost:8080/hello/norris
-> hello norris
1
2
3
4
5
2
3
4
5
# 5. Looking at the code.
This is how a typical Restful API is created.
Note the request/response architecture - the API route is expected to send a response immediately.
# Coming up...
Next we run this ZZZZ