You should use the CommonJS version of path
. If you want to grab path
directly...
git clone https://github.com/pazguille/path
from the working directory so it's loaded into ./path
. I changed the require
statement to point to that location.
#!/bin/bash | |
browserify main.js -o bundle.js |
<!DOCTYPE html> | |
<html> | |
<head> | |
</head> | |
<body> | |
<script src="bundle.js"></script> | |
</body> | |
</html> |
var path = require('./path'); | |
var userRoute = function(id) { | |
console.log(id); | |
}; | |
path('/user/:id', userRoute); |