Posts

HTML & CSS ATRIBUTES

 

Complete theory Javascript from zero to expert

Image
 Ja vascript is a high-level object-oriented multi-paradigm programming language what do we actually use for  HTML  CSS  Javascript hide paragraph  Interactive effects allow Dynamic effects and web applications in the browser React Angular Vajue Based on javascript Front-end  Node js Back-end applications Objects and primitives  VALUE  OBJECT  let me ={ name:'Jonas' }; Or PRIMITIVE  let firstName = 'Jonas'; let age = 30; There are 7 primitive data types 1 NUMBER floating point numbers used for decimals and integers let age = 23; 2 STRING sequence of characters used for text let firstName = 'Jonas'; 3 BOOLEAN Logical type that can only be true or false used for taking decisions let fullAge = true; 4 UNDEFINED: Value has taken by a variable that is not yet defined ('empty value) let children; 5 NULL also means an empty value 6 symbol (ES2015) Value Three forms to call variables in js  Let: could change in the future  Const: can't...

Query Parameters vs Route Parameters

 Route Parameters in "Dynamic Routes" In this section, you learned about "dynamic routes" that utilize route parameters to extract dynamic values from the URL path. For example: router.get('/restaurants/:id', ...) In this example, id is a route parameter that will hold different values when this URL / path is visited. For example, if a user enters /restaurants/r1, id will be equal to r1. Route parameters are super useful as they allow us to use one single route to load different data based on the concrete route parameter value. It is important to understand that the route parameter (:id in the above example) is a key part of the URL path. Just /restaurants would NOT be handled by the above route for example - because it's missing a value for the route parameter. Query Parameters We also learned about a concept called "query parameters" in this section. It's easy to mix up "query parameters" and "route parameters" but the...

EJS

Image
 EJS (Embedded JavaScript Templating) is one of the most popular template engines for JavaScript. As the name suggests, it lets us embed JavaScript code in a template language that is then used to generate HTML. In this article, I will walk you through a detailed guide to templating your Node application with EJS. First, we’ll cover the basics of template engines and setting up EJS, but we will move on to a more advanced guide to using EJS in your Node apps. Template engines According to Wikipedia’s definition, a template engine is a software designed to combine templates with a data model to produce, in our case, real HTML code.

More About The "JSON" Format

Image
  JSON is an acronym for "JavaScript Object Notation" and it's a standardized way of formatting text data into a machine- and human-readable format. JSON-formatted text data looks like this: {     "username": "Max",     "age": 32,     "hobbies": ["Sports", "Cooking"],     "address": {       "city": "Munich",       "street: "Some street 5"     } } It's called "JavaScript Object Notation" because the formatting resembles the "look" and structure of objects in JavaScript code. Though, it's important to understand that you can work with JSON-formatted data in JavaScript (e.g. you can read or write a file that contains data in that format) BUT it's not JavaScript-exclusive. Instead, it's a very common data format for all kinds of use cases and it's usable in basically all programming languages. Again: The above snippet is some text (...

Creating a Custom NodeJS Server

Image
To access the web pages of any web application, you need a web server. The web server will handle all the HTTP requests for the web application e.g IIS is a web server for ASP.NET web applications and Apache is a web server for PHP or Java web applications. Node.js provides capabilities to create your own web server which will handle HTTP requests asynchronously. You can use IIS or Apache to run the Node.js web application but it is recommended to use the Node.js web server. Create Node.js Web Server Node.js makes it easy to create a simple web server that processes incoming requests asynchronously. The following example is a simple Node.js web server contained in a server.js file.

HTTP response status codes

Image
 HTTP response status codes indicate whether a specific HTTP request has been successfully completed. Responses are grouped into five classes: