Hello fellow Node'rs,

I'm moving forward and getting close here with respect to my startup...
here's some background 
- https://groups.google.com/d/topic/nodejs/77TqZeWiEZM/discussion

I have another question and can't find direct documentation although many 
articles on similar topic...

I create bunch of events - and each event is stored in the db (mysql) - 
each event row has IdEvent, eventName, etc..and also a blank column called 
"eventURL".
now, what I want to do is - everytime an event is created by a venue, it 
gets stored in the databae and also an event-Detail page gets created - 
with the eventName as the name of the url. for e.g. if the eventName is" 
Chicago, the musical" - it would create a  new eventDetail page using jade 
template for event detail page that I have and it would name this url 
(including routing) as chicago-the-musical.
How can I do this programmatically vs. manually creating 
app.get(/chicago-the-musical.jade)?
I'm using Express, Jade...

Here's my current thinking - but am sure there's another way - also how do 
I turn eventName in to eventURL - named...
--> router.js
- app.get('/events', events.eventList); 
[Jatin] or does this need to look like this:
app.get('/events/idEvent', events.eventList);??
also, how does /events turn in to /chicago-the-musical?

--> events.js
- exports.eventList(….){
// call to data access and get list of all the events without a URL
- get a list of events…
- for each event in eventArray
{
1) Create Page URL (escape regex, replace spaces, commas, etc. with a 
hyphen) - how?
2) Store page URL in db in the event row column eventURL
3) res.render('eventPage', {
locals: {
eventData: event
}
});
}
})


Thanks,
Jatin

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to