-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Host out of www
directory
#2
base: master
Are you sure you want to change the base?
Conversation
I'm not sure I understand the intention entirely. The write space is relative to the root (the *Path stuff configs). Were you referring to something else? Using |
This just changed the defaults in the config and if absent. Feel free to try out and try these newfangled GitHub code review things. There's no hard coding. Just defaults. Let me know (for instance) of your current config and this code don't get along, but it should. |
Ok, I missed the obvious "Host out of However, I think this PR is unfinished. Code below starts server, and the request $ node index.js
Applied: /var/www/mayktso/config.json
Applying defaults:
{ port: '3000',
inboxPath: 'inbox/',
queuePath: 'queue/',
maxPayloadSize: 1000,
maxResourceCount: 10,
proxyURL: 'https://dokie.li/proxy?uri=',
hostname: 'localhost',
scheme: 'http',
authority: 'http://localhost:3000',
rootPath: 'www/',
basePath: '',
annotationPath: 'www/annotation/',
reportsPath: 'www/reports/' }
process.cwd(): /var/www/mayktso
rootPath: www/
curl -i http://localhost:3000
[2017-05-10 10:36:34.766] [LOG] GET http://localhost:3000/ {"host":"localhost:3000","user-agent":"curl/7.52.1","accept":"*/*"}
[2017-05-10 10:36:34.769] [LOG] GET http://localhost:3000/ { Error: ENOENT: no such file or directory, open 'www//index.html'
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: 'www//index.html' }
buffer.js:362
throw new TypeError('"string" must be a string, Buffer, or ArrayBuffer');
^
TypeError: "string" must be a string, Buffer, or ArrayBuffer
at Function.byteLength (buffer.js:362:11)
at sendHeaders (/var/www/mayktso/index.js:699:42)
at ReadFileContext.callback (/var/www/mayktso/index.js:707:9)
at FSReqWrap.readFileAfterOpen [as oncomplete] (fs.js:359:13) Request to The idea to just load from |
Made some more tweaks to deal with the |
@csarven does this need any more changes? |
Enforce local building of code--for now. Prevent accidently over sharing credentials.
This provides for bootstrapping a hosting directory with a minimal discovery HTML document. It is copied on the first run of the server, but not on subsequent runs to avoid overwriting changes. Re-bootstrapping simply requires moving the `index.html` from the `rootPath` directory.
rootPath is now...root. Other paths are all expected to be served from inside of rootPath (relatively).
Avoids double // issues
54e9a59
to
7077aa1
Compare
@csarven curious if you're still interested in this nearly-year-old PR. 😺 |
Sorry, let me come back to this. Still interested in this change. I recall that we wanted to keep maytkso working more or less the same way without breaking other stuff like https://github.com/csarven/ldn-tests which happens to extend it - sort of like a specialised site. So, I'll have to test the paths, configs etc on ldn-tests as well, and update both at the same time. |
createDir(config['rootPath'] + path); | ||
}); | ||
|
||
// rootPath folder does not contain an index.html file...so we'll copy the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we ship with www/index.html
and avoid this altogether? It is possible that the server may not want to have an index.html and so this shouldn't override that I think.
@csarven for what very little it's worth, I've (attempted to) resolve the conflicts here--which were minimal. I'm still happy to contribute to this project if you need/want. 😁 |
I've tweaked the defaults to host out of a
www
directory, so that the write space doesn't end up being identical to the code space.It makes things a bit easier to understand and manage when committing and updating. 😺