These are chat archives for jescalan/roots

23rd
Aug 2016
Marc Haan
@Hoenoe
Aug 23 2016 10:11

Hey @jescalan thanks for the support.

Can you maybe also explain me how to rout with only Node.

I hope it's not to big of a questing..

Marc Haan
@Hoenoe
Aug 23 2016 11:43
Do I need to set up my own node server or can I connect to the root server in any way?
Tom Kraak
@tkraak
Aug 23 2016 11:46
@Hoenoe please explain what you are trying to accomplish
Marc Haan
@Hoenoe
Aug 23 2016 11:48
@tkraak This is what I'm looking for:
I have a view called 'project' which shows dynamic content of all the projects.
So project 1, project 2 are all loaded in the view 'projects'.
What I need is for www.home/project/1 and www.home/project/2 to all use the same 'project' view/template.
Marc Haan
@Hoenoe
Aug 23 2016 11:55

but I only know how to rout when I build my own server like e.g. var server = http.createServer(function(req, res){ console.log('req was made:' + req.url); if(req.url === '/project' || req.url === '/project/*'){ res.writeHead(200, {'content-typ': 'text/html'}); fs.createReadStream(__dirname + '/public/project.html').pipe(res); } });

server.listen(3000, '127.0.0.1');

Tom Kraak
@tkraak
Aug 23 2016 14:02
sorry, I’ve not played with the dynamic content extension yet
Marc Haan
@Hoenoe
Aug 23 2016 15:06
I wan't to do it with just plain Node
Jeff Escalante
@jescalan
Aug 23 2016 17:33
@Hoenoe why dont you just extend the same layout with jade
i dont think you need to do any server work to make this happen
Marc Haan
@Hoenoe
Aug 23 2016 21:27
Hey @jescalan,
I was ignoring jade because the syntax just felt too weird to me, but I guess its time to put that feeling aside.
Thanks again!
Jeff Escalante
@jescalan
Aug 23 2016 22:56
you don't have to use jade, we support a ton of different languages
swap it out for one you are more comfortable with if you'd like
Tom Kraak
@tkraak
Aug 23 2016 23:15
@Hoenoe I felt the same way about jade 6 months ago and now I love it!