rumenmitov/quickServerProject
Launch a dev server quickly & easily! ⚡
|
|
||
|---|---|---|
| node_modules | Functionality for html files with names other than index.html | |
| .prettierrc.json | Functionality for html files with names other than index.html | |
| LICENSE.md | Create LICENSE.md | |
| package-lock.json | Functionality for html files with names other than index.html | |
| package.json | Functionality for html files with names other than index.html | |
| quickServer | Functionality for html files with names other than index.html | |
| quickServer.js | Functionality for html files with names other than index.html | |
| README.md | Update README.md | |
Quick Server 🖥
license image
Prerequisites ✅
Installation & Setup 📸
- Clone the repository and move / copy it to
/usr/local/bin - 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
- 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 - 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.