Reputation: 43531
app.get('/api/transactions/:hash([0-9a-fA-F]{64})', transaction.get);
I want anything that goes to /api/transactions/SOMEHASH
to be picked up by that route. All hashes will be 64 characters and be hex. However, this doesn't seem to work. Ideas?
Upvotes: 0
Views: 68
Reputation: 89557
Try this:
app.param('hash', /^[0-9a-fA-F]{64}$/);
app.get('/api/transactions/:hash', transaction.get);
Upvotes: 2