1 of 9

2 of 9

Take a think

The browser sends a verb and an address

The Express drops it down a predefined path.

Node returns the response.

Notice something?

The server doesn’t know or care a thing about you

3 of 9

REST

ReprESentaTion State Transfer:

  • A design paradigm at the heart of the internet
  • Encourages modularity
  • Enables scalability

4 of 9

RESTful criteria:

The complete list of criteria is longer, here below are the elements that are relevant for our current understanding:

  1. Client-server separation
  2. Ignorance of each others’ pasts, presents, and futures
  3. Stateless communication

“... the code is more what you'd call "guidelines" than actual rules.”

5 of 9

Client-server separation:

Neither the client, nor the server have direct access to each other’s file systems or back-ends.

  • For security
  • For modularity
  • For efficiency
  • For concurrency
  • For persistence

6 of 9

Ignorance of each other’s histories

Neither the server, nor the browser will store information about past transactions or internal states:

  • For efficiency
  • For security
  • For simplicity

7 of 9

Stateless Communication

The big one:

  • Each request and each response will contain all information necessary to carry out the required action.
  • The current state of the sender or receiver will not be relevant to the creating and sending of the message.

You must understand this one, so discuss.

8 of 9

What’s this all for?

To keep the server functional, because functional is :

  • Scalable
  • Efficient
  • Secure
  • Cross-platform
  • ...

9 of 9

pause.

Any questions? This is important.