Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

updated readme #3

Merged
merged 1 commit into from

2 participants

@andr3w321

No description provided.

@tblobaum tblobaum merged commit b019f2e into tblobaum:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 14, 2013
  1. @andr3w321

    updated readme

    andr3w321 authored
This page is out of date. Refresh to see the latest.
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`
Something went wrong with that request. Please try again.