Welcome!
Everything is fine.
Copying Node.js Apps¶
We have a lot to do today, so let's get started
Plan¶
- Announcements
- Copy and run example queries.
Announcements¶
- Grading status
Setting up Symlinks¶
We'll set up some essential symlinks in our account that each of our apps will refer to. That is, the symlinks in a particular folder for an app will refer to the symlinks in its parent folder, which will refer to real files and folders in our course account. We'll create the second set of symlinks first.
Make sure you understand what each of the following steps does:
- change to your personal cs304 apps folder
- create a symlink to the real
omnibus/node_modulesfolder in the course account - create a symlink to the real
apps/connection.jsfile in the course account - create a symlink to the real
apps/cs304.jsfile in the course account - list the directory. Notice the symlinks
cd ~/cs304/apps
ln -s ~cs304node/omnibus/node_modules .
ln -s ~cs304node/apps/connection.js .
ln -s ~cs304node/apps/cs304.js .
ls -l
Those are the symlinks to the real files and folders in the course account.
Example Queries¶
Next, let's set up an example app, with symlinks to the symlinks we just created. Here's what the commands will do:
- copy, recursively, w/ symlinks a folder from the course account
- go into the copied folder
- list its contents. Notice the symlinks
- run two examples
cp -rd ~cs304node/apps/exampleQueries queries
cd queries
ls -l
node find123.js
node exampleQueries.js
and remember we can do:
source ~/.cs304env.sh
mongosh $MONGO_URI