Open philipstratford opened 6 years ago
Somewhat I can answer:
server.js
and config.js
files of the example/
. If you want to run on root folder, make your server.js
and config.js
on root and point them to ./app/index.js
instead of var raneto = require('../app/index.js')
. content/
dir is set by default in config.js
content_dir
public/
is located inthemes/default/public
. You can create your own theme and specify it in config.js
under theme_name
and public_dir
, then it will be themes/[yourthemename]/public
.Thanks very much for taking the time, @dkbnguyen. I think my most pressing question at the moment is question 3, but I don't think I get it even after reading your answer. I understand that server.js
and config.js
are responsible for a lot of the configuration but what tells Raneto to look in the example
folder for these files in the first place? For example, if I made a copy of the example
folder in the same location and called it example2
, how would I tell Raneto to load the config.js
and server.js
files in THAT folder instead?
According to this repo setup, the example
is the one telling its files (config and server) to look for raneto one level up (parent folder), as you can see here. Therefore it wouldn't make any difference if you make a example2
with the exact same settings.
I feel like this repo setup of example would make new nodejs devs confused. I've made an example of setting up raneto as a dependency using package manager: dkbnguyen/raneto-demo, with clean and structured setup I hope it would help you understand easily. Feel free to ask if you run to any issues.
Here is another example of running raneto directly: dkbnguyen/Raneto--dev
I just simply moved content/
config.js
server.js
to root folder, changed some *_dir paths in config.js
, and finally address the raneto and config vars in server.js
. Detailed changes are in commit history.
Thanks once again for your help. I don't know if I'm missing a key point (I probably am!), but even with your examples I can't see how node.js knows which instance of Raneto to load. If you created three copies of example
in the root Raneto folder, named them example
, example1
and example2
, then ran Raneto, you'd always get your content at localhost:3000 served from example
. I'm trying to figure out how to change that behaviour, and I think I have.
In package.json
in the root Raneto directory, lines 32 and 33 contain the path to the server.js
file which is loaded when Raneto is started. By altering the path in these lines (only line 33 is relevant to me as I'm running Raneto on a Windows box, but best to change them both) to point to my own subfolder, e.g. example2
, and then restarting the application, Raneto is served up from the directory I specify.
I've changed the path in line 37 pointing to my documentation's .js
files too.
Firstly, I think Raneto looks great and is just about the only project I've come across which will (I think!) let me host my application's documentation on an internal company rather than in the cloud, which is a requirement. However, I'm having trouble with some of the initial post-install configuration and can't help thinking that another page in the documentation after "Installing Raneto" would be really useful! Also, the documentation seems to assume good familiarity with node.js, which I do not have. Anyway, my questions are:
I've read the documentation about this on the "Production Notes" page but I don't understand it. Why is just changing the port env variable to 80 not recommended? Seems much easier than implementing a local reverse proxy and it is a web server, after all - everything else is served on port 80.
The line
means nothing to me. Where is this environment variable? Is it a node thing or a Raneto thing? What is my shell's profile? I'm sure this is basics to someone familiar with node.js, but I'm not.
I can see that all the pages which make up the documentation immediately after install are in the
example
folder, but if I create a folder alongsideexample
, how do I configure Raneto to load pages from my folder'scontent
sub-folder instead ofexample
's? How do I configure my folder to be the root folder for Raneto's documentation?There are several references in the documentation to the
public
folder and it is implied that this folder is created by default, but I can't find this folder anywhere within the Raneto folder. Am I supposed to create it manually? If so, where? There was a note somewhere in the documentation which I now cannot find about why this folder is required to protect files from editing, which I also didn't understand.Sorry for all the questions and for the fact that this probably isn't the ideal forum for asking them (I did check on StackOverflow first but there's only one question containing the word Raneto). For idiots like me a tutorial for configuring Raneto from installation to a production environment would be really useful. If I ever figure it out I'd be happy to write one - as you can see, I have no problem writing lots of text!