Difference between revisions of "Running Sites Locally"
Jump to navigation
Jump to search
Riley.McCuen (talk | contribs) (New webserver startup instructions) |
|||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 2: | Line 2: | ||
# Open a terminal window or the terminal in your code editor (I recommend doing this directly in VSCode). | # Open a terminal window or the terminal in your code editor (I recommend doing this directly in VSCode). | ||
| − | # Navigate to your repository folder. This should be something like: | + | # Navigate to your repository folder. This will vary by project. Information foraging should be something like: information-foraging-<YOUR_GITHUB_ID>-wustl. |
# Make sure that all the necessary dependencies have been installed for your project. You can do this by running: | # Make sure that all the necessary dependencies have been installed for your project. You can do this by running: | ||
<pre>npm install</pre> | <pre>npm install</pre> | ||
| Line 9: | Line 9: | ||
<pre>npm run dev</pre> | <pre>npm run dev</pre> | ||
# It may take a few seconds, but this should automatically open your website in your browser. Feel free to make changes to any of your code and the webserver will watch for updates that you make. If it notices new updates it will recompile your application and push the new copy to your web browser automatically. | # It may take a few seconds, but this should automatically open your website in your browser. Feel free to make changes to any of your code and the webserver will watch for updates that you make. If it notices new updates it will recompile your application and push the new copy to your web browser automatically. | ||
| + | ## To ignore those pesky alerts that keep popping up make sure to use this URL and feel free to configure it differently according to the instructions below: http://localhost:3000/?wustl_key=riley.mccuen&sandbox=true&project=information-foraging&iteration=1&tag=books | ||
| + | ## You will notice that the beginning of the url is the same as the regular url (http://localhost:3000) and everything after that is called the query string. If you would like to change the task that is being displayed on your page then feel free to edit query string parameter called tag. | ||
| + | ## Valid values for tag can be found in your repository in at this location: <your repository path>/scenarios/scenarios.json. You can see the valid tags are all of the "tag" attributes of the objects in the array. | ||
| + | ## An example url for the task with the tag of "math" would be the following url: http://localhost:3000/?wustl_key=riley.mccuen&sandbox=true&project=information-foraging&iteration=1&tag=math | ||
# When you are done using your webserver, you can turn it off by clicking on your terminal and then 'CTRL+C'. | # When you are done using your webserver, you can turn it off by clicking on your terminal and then 'CTRL+C'. | ||
Latest revision as of 16:51, 4 August 2022
There are some custom scripts developed that provide an easy way to to test your submissions locally as you work on your assignments.
- Open a terminal window or the terminal in your code editor (I recommend doing this directly in VSCode).
- Navigate to your repository folder. This will vary by project. Information foraging should be something like: information-foraging-<YOUR_GITHUB_ID>-wustl.
- Make sure that all the necessary dependencies have been installed for your project. You can do this by running:
npm install
- NOTE: You only need to install dependencies once for each project.
- Next, start a local webserver from your project directory by running:
npm run dev
- It may take a few seconds, but this should automatically open your website in your browser. Feel free to make changes to any of your code and the webserver will watch for updates that you make. If it notices new updates it will recompile your application and push the new copy to your web browser automatically.
- To ignore those pesky alerts that keep popping up make sure to use this URL and feel free to configure it differently according to the instructions below: http://localhost:3000/?wustl_key=riley.mccuen&sandbox=true&project=information-foraging&iteration=1&tag=books
- You will notice that the beginning of the url is the same as the regular url (http://localhost:3000) and everything after that is called the query string. If you would like to change the task that is being displayed on your page then feel free to edit query string parameter called tag.
- Valid values for tag can be found in your repository in at this location: <your repository path>/scenarios/scenarios.json. You can see the valid tags are all of the "tag" attributes of the objects in the array.
- An example url for the task with the tag of "math" would be the following url: http://localhost:3000/?wustl_key=riley.mccuen&sandbox=true&project=information-foraging&iteration=1&tag=math
- When you are done using your webserver, you can turn it off by clicking on your terminal and then 'CTRL+C'.