Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Using a more node like pattern on the express server. #71

Merged
merged 4 commits into from Jan 4, 2012

Conversation

nrn
Copy link
Collaborator

@nrn nrn commented Dec 31, 2011

I'm attempting to use a more node like pattern by splitting server/express/server.coffee into ./bin/server as an executable command line utility, and ./lib/server.coffee as a generator for servers. Other helper files have been moved to ./lib as well. ./index.js was created so that you only need to require('server/express') to use it in node. Unfortunately I don't pass any more tests, but hopefully I will have time to work on that more soon.

@nrn
Copy link
Collaborator Author

nrn commented Jan 2, 2012

Implemented handling of urls by pushing my problems into the client side. Now if the pages shown in the url disagree with the pages shown in the html when client.js is loaded it will create the pages and append them to '.main'. I'm not sure if this is an acceptable long term solution, but it solves the problem of not being able to use the haml templates in other back ends for now. This commit takes the express server to 14 tests passed, 2 failed.

@nrn
Copy link
Collaborator Author

nrn commented Jan 3, 2012

I was just re-watching some of the videos on http://wardcunningham.github.com/ which lead me to try an interesting experiment in light of this last commit:

http://nickn.github.com/view/welcome-visitors/view/indie-web-camp/view/why-indie-web

I'll leave up the repository with default data for a bit just to explore the possibilities.
https://github.com/nickn/nickn.github.com

@WardCunningham
Copy link
Owner

Nick -- I'm having a little trouble understanding what this modification to the client does:

urlPages = (a for a in $(location).attr('pathname').split('/') by 2)[1..]
for urlPage in urlPages when urlPage not in pagesInDom()
   createPage(urlPage).appendTo('.main')

I'm guessing that it relieves the server from any obligation to create the DIVs for requested pages in the "view" style url. I'm worried that it doesn't handle the case where "view" is replaced with a remote server domain name. (Regretfully the existing remote-domain logic is incomplete and poorly tested.)

@nrn
Copy link
Collaborator Author

nrn commented Jan 3, 2012

Yeah, that did come out a bit obfuscated. When client.js loads It takes the current path name, splits it into a list on the '/', ignores every other one (making the bad assumption that it is always "view"), and then splices out the empty string from the leading '/'. It then iterates over the list, and if the sting isn't the id of a page in the dom adds it.

Hmm, just found an example with the remote site syntax, I don't think that this should have any effect stuff served by the ruby server, with or with out remote sites, but i'll get that included soon.

@WardCunningham
Copy link
Owner

I'll merge this pull request on my laptop and double check that the ruby server is not effected. Adam did most of the code that handles scrolling through multiple wiki pages in one web page. He also handles the interface with the browser history. There has been lots of meandering discussion about this under issue #40.

@WardCunningham WardCunningham merged commit d41c0a5 into WardCunningham:master Jan 4, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants