FAQ
Thanks Ryan - that's correct. I want to get a url like that for any event
that is created in the events table in the db.
Thanks for the help - I'll try out the slug-way...
On Wednesday, March 20, 2013 4:47:53 PM UTC-4, ryandesign wrote:

You would like users to be able to access a URL like the following, right?

http://example.com/events/chicago-the-musical

To accomplish this, you'll need a column in your database table that
contains e.g. for this record the string "chicago-the-musical". I've heard
this type of value referred to as a "slug" so I'll call it that.

Your route will be something like:


app.get("/events/:slug", function(res, res) { ... });


In the "..." code, "chicago-the-musical" will be available to you in
req.params.slug. You can query your database for that to get the relevant
record.


On Mar 20, 2013, at 13:15, Jatin Patel wrote:

Sorry - am drawing a blank - I guess I must be not getting something
simple here.
--
--
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 nodejs@googlegroups.com
To unsubscribe from this group, send email to
nodejs+unsubscribe@googlegroups.com
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 nodejs+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 10 | next ›
Discussion Overview
groupnodejs @
categoriesnodejs
postedMar 19, '13 at 5:37p
activeAug 9, '13 at 5:52p
posts10
users5
websitenodejs.org
irc#node.js

People

Translate

site design / logo © 2021 Grokbase