3/8/2023 0 Comments Run a tagspaces serverFor more information, see the Why section on the lite-server GitHub README. However, Single Page Apps typically use routes which Browsersync doesn’t handle. Actually, it is Browsersync that does most of the “heavy-lifting”. Lite-server is just a wrapper around Broswersync. Then use npm start to start serving web pages. This installs the lite-server package and adds it to the devDependencies in our project’s package.json file. To add lite-server to our project we can run: npm install -save-dev lite-server The -y tells it to just use the defaults for any parameters. We use npm to initialize an empty project. In our lite directory, add an index.html file that looks like this: Install lite-serverĪt the command prompt in your lite directory, run: npm init -y This creates a new directory called lite and makes it our working directory. Create a ProjectĪt your command prompt, run: mkdir litecd lite Then, we’ll use lite-server to serve our web page. So let’s take advantage of John’s work by actually… Using lite-server in a Web Projectįirst, we will create a small web project with a simple index.html. But know that when you do, lite-server will still be there for you. Maybe you aren’t using JavaScript GUI Frameworks like Angular, React, and Vue.js just yet. John created lite-server because he wanted a simple web server he could use to test deploying Single Page Applications that leverage URL routes. You should follow him and read all his stuff, because he is a true hero of the open source community! John Papa ![]() But, for our purposes, that’s good enough. Actually, it is bit more technical than that. By design the http protocol has a get request which returns a file on the server. ![]() If you have a lot of notes to manage or just want to store a wealth of knowledge you gain every day, a hierarchical note-taking application like cherrytree should be the perfect choice. ![]() To create a custom web server, we need to use the HTTP protocol. cherrytree is a quite popular hierarchical note taking application for power users. Run the code below to start a custom web server. Lite-server is a lightweight development web server with support for Single Page Apps (SPAs). This is a default server that you can use to download files from the machine.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |