minor fix for visit directory

When user visit http://localhost:8888/, the node server will throw errors and halt because of the directory visit, so we need to check if the visit resource is file or directory, and lead users to the destination