- Open ‘webpack.config.js’ file.
- Under devServer add port:’port number’
It will look something like this
- By default the app will run on port 8080 if you dont mention the port number
I am writing my experiences and learning to help others
It will look something like this
Babel is a Javascript transpiler which converts ES6 Javascript into plain vanilla Javascript ES5 which is understood by all browsers.
Here is a sample code in ES6
class Employee {} var narendra = new Person
The above code in ES5 look like below
"use strict"; function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } var Employee = function Employee() { _classCallCheck(this, Employee); }; var narendra = new Person();
Web Development is often confused with another term web design. Web designers use tools like Adobe,Logo design,graphic design and decide on how the colors and feel of a website should be. Web developers get the things to life by making use of tools like HTML, CSS and JavaScript. Web Developers are two types. One is front end or client side and other is back end or server side. The one we are speaking of now is Front end developer.
We need to write a function to remove duplicates from an array.
function(arr){
let unique=[];
for(let i=0;i<arr.length;i++){
if(unique.indexOf(arr[i])== -1)
{
unique.push(arr[i]);
}
}
}
return unique;
}
Today we will go through setting up git and creating our first repository.
Follow the steps below:
Now we can add files in this folder. Once the changes are made we will first stage these changes by using command
git add <Filename>.
We can use this command number of times and add files or we can use command
git add -A
to add all files in the folder.
After all the files are added we need to commit the changes. This is done by using command
git commit -m “Your message here”.
Before committing it will ask to set username and email to identify the users who are committing to this repository. These values can be set by using commands
git config –global user.name “Your Name”
git config –global user.email “Your Email”
If you want to make use of the details for only this repository you can omit global and run the commands.
git remote add origin https://github.com/narendravenkata/Test-Demo.git
git push -u origin master
We all have doubts about what to use when implementing authentication at client side,whether I save the token I get from the server as cookie or should i use the local storage of browser. Here I will point out some of the differences between cookie and token. You can decide what fits more into your application.
Cookie
|
Token
|
Automatically included in all requests
|
We must manually include in the requests
|
Cookie is unique to each domain. We have different cookies for amazon, eBay, google etc.
|
We can send token to any domain
|
Requset:
Headers
Cookie:{}
Body{
Name:’ABc’
}
|
Requset:
Headers
Authorization:’adbdghgber495yjfkhjhl’
Body{
Name:’AB’
}
|
Cookies bring state to stateless http protocol
|