Overview

Welcome to the server-side! In this slide deck, we will be covering the basic aspects of servers, like what they are and how they relate to your viewing web pages!

What is a server?

Server is a term that refers to both hardware and/or software. It is used to define the relationship between the computer a user is interacting with (client) and the distinctly different environment that said user will request information from.

When dealing with hardware, it:

When dealing with software, it:

Requests

Servers have uniquely defined rules that determine how they will respond based on a request.

The request:

Responses

Servers have uniquely defined rules that determine how they will respond based on a request.

The response:

Headers

When requests and responses are sent between server and browser, additional information is included in headers

The header can be loosely categorized based on its context: request, response, or general

Server-side programming

"Server-side" is meant to describe everything that happens in between a request and a response.

Server-side code:

Server Environment

All code needs to run in some sort of environment, which affects the syntax, and options available to you.

When we are doing DOM Scripting, working with React, or otherwise doing client-side coding we are working in the browser's environment

Server-side JavaScript generally runs in a Node environment

Welcome Back Node!

If Node.js sounds familiar, that's because we started this course programming in a Node environment!

Differences Between Node and the Browser

Server and Client

The Server and Client sides to your application have separate, but related jobs, and each is useful for specific things.

Together they make a full stack application

Structuring your Directory

When creating a full stack application, your server file should live at the root level of your project, while all the client side code should live in a dedicated subdirectory; often called client or public

directory file structure

Setting up Your Client with React

create-react-app can be used to easily generate a React front end for your application.

React server example

React server example

React Caveats

When using a React front end there are a couple things to keep in mind

Resources

Next 

Outline

[menu]

/