K
K
keslo2014-03-14 20:58:29
Node.js
keslo, 2014-03-14 20:58:29

How to specify the root directory for the server in NodeJS?

Good afternoon, ladies and gentlemen!
How can I specify for NodeJS the root directory that should open when the page is opened, for example, localhost:8080 ?
At my default address, the Windows system folder opens, although the server file is in a folder on the desktop. And I just need this folder, in which the file is located, to be the root.
I'm using the NodeJS server code from the AngularJS Learning archive from here - https://github.com/angular/angular-phonecat/blob/m...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Bazhenov, 2014-03-17
@benign

In environment variables you can set NODE_PATH
nodejs.org/api/modules.html here is everything you need

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question