Control brightness and color of LEDs
https://code.visualstudio.com/docs/editor/extension-marketplace#_recommended-extensions Install all of the VSCode extensions
- Ctrl + Shift + P (Open the Command Pallete)
- Extensions: Show Recommended Extensions
- Click on the cloud icon to "Install Workplace Recommended Extensions"
Once you have downloaded and installed Node.js on your computer, let's try to display "Hello World" in a web browser.
The code tells the computer to write "Hello World!" if anyone (e.g. a web browser) tries to access your computer on port 8080.
Node.js files must be initiated in the "Command Line Interface" program of your computer.
How to open the command line interface on your computer depends on the operating system. For Windows users, press the start button and look for "Windows Powershell", or simply write "powershell" in the search field.
Navigate to the folder that contains the file "helloWorld.js", the command line interface window should look something like this:
C:\Users\Your Name>_ Initiate the Node.js File The file you have just created must be initiated by Node.js before any action can take place.
- Make sure you are at the root of this directory
- Start your command line interface, write
node helloWorld.js
and hit enter:
Now, your computer works as a server!
If anyone tries to access your computer on port 8080, they will get a "Hello World!" message in return!
Start your internet browser, and type in the address: http://localhost:8080
You can exit out of the script running by pressing Ctrl + C
Run all commands as an admin in the root of the server directory
- Download typescript globally
npm install -g typescript
npm install
- For Development ( all TS files in
./src
):npm run devStart
- For Build ( all JS files in
./build
):npm run build
- For Production ( all JS files in
./build
):npm run start
package.json
are where the scripts are configuredtsconfig.json
defines that the built JS code populates in./build
and that the source directroy is./src
Talk with Aaron or Jason for credentials.
IMPORTANT: Do not push the credentials up to Github
Run all commands in the root of the server directory
MongoDB is the database that the project is using and a connection can be established to the server using nodeJS.
- Get the credentials from Aaron or Jason
- MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD
- MONGO_INITDB_DATABASE
- Open a Git Bash terminal in VScode
export MONGO_INITDB_ROOT_USERNAME=<username>
export MONGO_INITDB_ROOT_PASSWORD=<password>
export MONGO_INITDB_DATABASE=<database>
npm install
npm run devStart
- PASS:
0 connecting 2 connected 1 disconnecting 3 disconnected 0
- FAIL:
0 connecting 2 disconnected 0 C:\Users\<machine>\git\luminosity-led\server\node_modules\mongodb-connection-string-url\lib\index.js:111 throw new MongoParseError('URI contained empty userinfo section');