I play with a simple Connect file server:
var connect = require('connect'), http = require('http'); connect() .use(connect.static('.')) .listen(3000);
The index.html file loads when I am localhost:3000 . But I can not access another file as I expected. For example, the localhost:3000/json-parser.html returns Error: Forbidden followed by information about the Connect module (I will not include everything here unless requested because it is quite long and I suspect there is a simple answer to this question).
I changed my server by following the code here to serve the βpublicβ folder in my directory:
var connect = require('connect'), http = require('http'); connect() .use(connect.static('public')) .listen(3000);
But I want to access scripts and files inside folders in the parent directory, which is impossible without putting everything in the "public" and without using my Connect file server. Is there a connection method for the directory service around it, given that the above does not work?
guypursey
source share