Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use harmon on specify url #29

Open
epubreader opened this issue Sep 7, 2015 · 1 comment
Open

how to use harmon on specify url #29

epubreader opened this issue Sep 7, 2015 · 1 comment

Comments

@epubreader
Copy link

I want to only use harmon to replace something on homepage, how to specify the url?

@No9
Copy link
Owner

No9 commented Sep 7, 2015

Hi @eimhee
Rather than passing the harmon middleware straight as in
https://github.com/No9/harmon/blob/master/examples/doge.js#L54
You will probably have to wrap it with your own middleware that applies your rules before passing it to harmon.
You can look at harmon code it's self to see how the middleware pattern works.
The key piece is that you make a module that returns a function that takes (req, res, next)
https://github.com/No9/harmon/blob/master/index.js#L120

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants