Skip to content
Browse files

updated readme

  • Loading branch information...
1 parent a38ef3a commit 570c50b50d8f99c2ebcd19a7d4f4fad00ceb1614 @andr3w321 andr3w321 committed
Showing with 15 additions and 4 deletions.
  1. +15 −4 README.md
View
19 README.md
@@ -9,24 +9,35 @@ Subdomains are placed at the beginning of a route by default.
var subdomains = require('express-subdomains')
, express = require('express')
- , app = Express.createServer()
+ , app = Express.createServer();
// example: api.example.com/user -> '/api/user'
subdomains
.use('api')
- .use('other.vanity.domain')
+ .use('other.vanity.domain');
-app.use(subdomains.middleware)
+// Place this line before
+// app.use(app.router)
+app.use(subdomains.middleware);
+// Path for domain/api/user and api.domain/user
app.get('/api/user' function (req, res, next) {
// ..
})
-app.listen()
+app.listen();
````
+## Testing locally
+
+Add the following line(s) to your /etc/hosts file
+```
+127.0.0.1 api.localhost
+127.0.0.1 other.vanity.domain.localhost
+```
+
## Tests
`npm install mocha -g` and `make test`

0 comments on commit 570c50b

Please sign in to comment.
Something went wrong with that request. Please try again.