Server Side Code

Server-side code processes user input and delivers HTML, CSS and Javascript files to the user-requested web page

A website’s code is broadly structured as server-side code and client-side code. For websites having a Model-View-Controller architecture, the server-side code determines what content to display on a web page. In an MVC web application, the View Controller script processes the web page URL and displays the web page associated with that particular URL route.

Most web pages on the internet are dynamic. Dynamic web pages are comprised of different elements that are combined on the server side before being rendered on the browser. The page need not exist as a static HTML file inside a database. Popular server-side scripting languages include Node.js, Django framework for Python, Ruby on Rails, PHP and ASP.NET.

As browser Javascript engines have improved, many sites also include a front-end viewing logic. This viewing logic renders the web page using the client-side Javascript code. This avoids having to make the time-consuming HTTP requests from the server each time that a user wants to access a new page. It is indeed possible to create a website only using client-side Javascript - such web applications are called Single-Page Applications (SPA)

However, sensitive and confidential information should not be stored on the client-side. Because of this, most modern web applications comprise an SPA for rendering the web page, and server-side code for passing data to the interface. The SPA and server-side code communicate with each other using APIs. In such a scenario the server-side code is organized according to a microservices architecture.