Update directory.js

test ip outside UoP
Update main.html

change link to directory to run function instead.