NOTE: THIS IS THE STARTER CODE. FOR THE DEPLOYED CODE, GO TO THE complete_code
branch.
- Node 18+
- JSON Server
- A browser capable of running JavaScript (Chrome, Firefox, Safari, or Edge)
- Operating System (Windows 10+, MacOS, Linux, etc.)
- A text editor capable of running JavaScript (Visual Studio Code, Vim, Nano, Emacs, Atom, Sublime Text, etc.)
- RAM >= 4GB
- Disk space >= 1GB
To use this repo, follow these steps:
-
Open the terminal/CLI on your computer.
-
If you don't have JSON server installed in the terminal, install it globally using the following command:
npm install -g json-server
-
Clone the repository by running the following command:
git clone https://github.com/oyieroyier/deploying_a_local_server.git
-
Change directory to the repo folder:
cd deploying_a_local_server
-
Open it in your Code Editor of choice. If you use VS Code, run the command:
code .
-
On the top right corner of this page there is a button labelled
Fork
. -
Click on that button to create a copy of the repository to your own account.
-
Follow the process described in
Alternative One
above. -
Remember to replace your username when cloning.
git clone https://github.com/your-github-username-here/deploying_a_local_server.git
-
Open the integrated terminal in your code editor and run
json-server
:json-server watch db.json
-
Open the index.html file in Mozilla Firefox, Safari or any Chromium-based browser.
-
If using VS Code, you can use the Live Server extension to run the file on the browser for live reloading.
-
Click HERE to install the Live Server extension and to read instructions on how to use it.