rumenmitov/quickServerProject
1
0
Fork
You've already forked quickServerProject
0
Launch a dev server quickly & easily!
JavaScript 87.3%
Shell 12.7%
Find a file
2023年02月16日 12:12:58 +00:00
node_modules Functionality for html files with names other than index.html 2023年02月16日 11:00:55 +00:00
.prettierrc.json Functionality for html files with names other than index.html 2023年02月16日 11:00:55 +00:00
LICENSE.md Create LICENSE.md 2023年02月16日 11:34:25 +00:00
package-lock.json Functionality for html files with names other than index.html 2023年02月16日 11:00:55 +00:00
package.json Functionality for html files with names other than index.html 2023年02月16日 11:00:55 +00:00
quickServer Functionality for html files with names other than index.html 2023年02月16日 11:00:55 +00:00
quickServer.js Functionality for html files with names other than index.html 2023年02月16日 11:00:55 +00:00
README.md Update README.md 2023年02月16日 12:12:58 +00:00

Quick Server 🖥

license image

Prerequisites


Installation & Setup 📸

  1. Clone the repository and move / copy it to /usr/local/bin
  2. Execute the following commands:
cd /usr/local/bin/quickServerProject
sudo npm install
sudo chmod +x /usr/local/bin/quickServerProject/quickServer 
sudo cp /usr/local/bin/quickServerProject/quickServer /usr/local/bin 
  1. Now you can run it with quickServer file_path, where instead of file_path you put the absolute file path of the html file that you want to host
  2. You can now find your website on localhost:3000

Vim Usage

If you are editing a html document in vim and want to quickly host it, add the following to your .vimrc file:

command QuickServer !quickServer %:p 

Save your configuration and you can now host the html page with the following vim command: :QuickServer
NOTE: Make sure you have sudo priveleges beforehand (i.e. try sudo vim, exit and then open your html file)!


Further Information 📖

The server is hosted in the background and you can run ps aux | grep 'node' to find its process id. You can then kill the process with: sudo kill -9 process_id. Make sure to replace process_id with the process id from the ps aux command.
NOTE: The server remains active until you close your terminal.