36
loading...
This website collects cookies to deliver better user experience
HTML stands for HyperText Markup Language, where HyperText refers to text that contains references to some other text. So essentially, that's how you jump from one web page to another.
<!-- HTML -->
<button>I'm a Fancy Button!</button>
/* CSS */
button {
color: value; /* consider 'value' as a placeholder */
background: value;
border: value;
padding: value;
border-radius: value;
box-shadow: value;
}
button {
color: white;
}
/* This will override the previous value for 'color' */
button {
color: black;
}
myName
that we can do anything with.var myName = 'Sapinder Singh';
// assuming the button does have an id
var fancyButton = document.getElementById("fancy-button");
/* Don't worry if you don't understand the syntax,
you're here just to understand what it does. */
fancyButton.onclick = () => alert("I've been clicked! :)");
GET
request to the server asking for a web page present on that route.POST
method as shown in the snippet below.
<!-- HTML -->
<form method="POST">
<!-- The form fields go here -->
</form>
CREATE an http server using http.createServer()
CALL server.listen() to activate the server
// Now handle requests from different routes, e.g. '/home' or any route
IF request.url EQUALS '/home'
SEND '/home.html'
ELSE IF request.url EQUALS '/create-user'
// the user wants to visit the page where it can create a new account
IF request.method EQUALS 'GET'
SEND '/create-user.html'
// if the method is POST, it means the user submitted a form on '/create-user' route
ELSE IF request.method EQUALS 'POST'
SEND newlyCreatedAccount
POST
method on /create-user route, we're trying to create a new user based on the data received via request
object; and then provide that newlyCreateAccount
to the user. But we actually need to store that account to remember it in the future. So, it's time to head to the next section.8000
is a port number. But instead of hosting our server locally, we now need to host it somewhere else to make it available to the world. We want to deploy our app to a hosting Fun Fact
You can have any number of subdomains once you own the domain name. Also, www is a subdomain too!
main
and development
. main
is the default branch when git is implemented, whereas I keep a separate development
branch for development purposes. The number and purpose of branches may increase in large scale projects.git add <file-name>
command in order to
be able to review the changes before making a final commit, which leads us to the next point.git commit
command that finally creates a new version in the git history for our code repository.development
branch, and I've tested them as well, now I can merge
them into my main
branch to publish changes to the server.revert
our current version to any of the earlier commits by using that commit's ID. There are many other things that version control systems allow us to do that you would get to know as you use them.