Answer the question
In order to leave comments, you need to log in
Why test layout on a local server?
I am a novice coder, and at the very first stages of acquaintance with the topic, the question arose: why raise a local server for testing the layout, if it is enough just to open an .html page, to which styles and scripts from neighboring folders will be pulled up? For example, Gulp raises a local server at localhost:3000. How can this help with layout testing?
Answer the question
In order to leave comments, you need to log in
Gulp and a local server are needed not for testing for the most part, but for convenient development and further debugging.
Imagine you are creating your first html page, dancing and clapping your hands in delight, you like it, you get high from technology, layout, etc. Time passes - you have added 2.3 works to your portfolio. The layout becomes the same type, a bit routine, the process is as long as the first time, and you start thinking about "automating" the process. The thought “I don’t want to constantly press F5 and refresh the page after each change, I want everything to be on the fly” arises in your head. You install gulp-browsersync and enjoy the fact that the process is automated. Next you putgulp minification, concatenation, prefixes, compression, maybe some debugging tricks that help you type faster, better, make the code clean and beautiful.
The market is very dynamic, if you develop in the old fashioned way by opening each individual html page, you won't get far. Not to mention CMS systems, through which it is convenient to work on a local server in conjunction with gulp. There you already write not html, but let's say php - and browsersync still works.
For example, the Gulp builder raises a local server at localhost:3000. How can this help with layout testing?As far as I remember, Gulp itself does not raise anything, but this is not the point ... A server, local, is needed at least to be able to specify paths that are correct in relation to the root of the server , for the same pictures, for example: - without a local server it will work "no way ". Already this fact is enough to raise this very server :)
<img src="/img/image1.png" alt="#" />
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question