Hacker News new | ask | show | jobs
by swimmadude66 2484 days ago
Rather than trying to exhaustively predict all the pages you could ever want, maybe it would be smarter to build this as a middleware. That way you could also support things like post requests, multiple emojis in a path, or paths off of something other than root.

Additionally, you could allow your code to accept a mapping of emojis to strings. That way people could use other emojis without hammering you to support them, and the same emoji could be used to represent different strings on different sites.

Overall I think its a cool idea, but if I were you I'd be worried about the huge amount of work to extend this functionality as-is if it got popular.

2 comments

Yeh that makes sense, I'll have to come up with a solution for that. I didn't think about it that deeply yet tbh, I just snapped it together as a tongue in cheek project.

I'll explore some solutions for scaling and customizing it, thanks!

Solved it! Routes can be associated with simple one liners now.

For example: emoji.set(':emojisymbol:', '/whatever/route/here')

Thanks again for the input!

Awesome, looking forward to trying it out!