Skip to content

Conversation

@daffl
Copy link
Member

@daffl daffl commented Jan 4, 2014

This pull request adds an app.setup(server) method to allow setting up a Feathers application with a different server than the on used in app.listen. This closes #25 and allows to easily use HTTPS servers and virtual hosts for both, SocketIO and REST, as added to the documentation:

HTTPS

With your Feathers application initialized it is easy to set up an HTTPS REST and SocketIO server:

app.configure(feathers.socketio()).use('/todos', todoService);

var https = require('https');
var server = https.createServer({
  key: fs.readFileSync('privatekey.pem'),
  cert: fs.readFileSync('certificate.pem')
}, app).listen(443);

// Call app.setup to initialize all services and SocketIO
app.setup(server);

Virtual Hosts

You can use feathers.vhost (which is the same as Express and Connect .vhost) to run your Feathers app on a virtual host:

app.use('/todos', todoService);

var host = feathers().use(feathers.vhost('foo.com', app));
var server = host.listen(8080);

// Here we need to call app.setup because .listen on our virtal hosted
// app is never called
app.setup(server);

Also adds an app.service(path, service) convenience method as suggested by @whitecolor in #22 (app.use(path, service) will still work).

daffl added a commit that referenced this pull request Jan 4, 2014
Add app.setup() to support HTTPS
@daffl daffl merged commit e582baa into master Jan 4, 2014
@daffl daffl deleted the https-22-25 branch January 4, 2014 15:05
daffl pushed a commit that referenced this pull request Aug 19, 2018
daffl pushed a commit that referenced this pull request Aug 21, 2018
daffl pushed a commit that referenced this pull request Aug 21, 2018
daffl pushed a commit that referenced this pull request Aug 21, 2018
daffl pushed a commit that referenced this pull request Aug 21, 2018
Created a Code Climate config with ESLint and Duplication enabled. Also, enabling PR integration.
daffl pushed a commit that referenced this pull request Aug 22, 2018
Created a Code Climate config with ESLint and Duplication enabled. Also, enabling PR integration.
daffl pushed a commit that referenced this pull request Aug 22, 2018
daffl pushed a commit that referenced this pull request Aug 23, 2018
daffl pushed a commit that referenced this pull request Aug 25, 2018
daffl added a commit that referenced this pull request Aug 28, 2018
daffl added a commit that referenced this pull request Aug 28, 2018
daffl pushed a commit that referenced this pull request Aug 28, 2018
* chore(package): update jsonwebtoken to version 8.0.0

* Add babel-polyfill to tests for Node 4
daffl pushed a commit that referenced this pull request Aug 29, 2018
daffl added a commit that referenced this pull request Aug 29, 2018
daffl added a commit that referenced this pull request Aug 29, 2018
daffl pushed a commit that referenced this pull request Aug 29, 2018
* chore(package): update jsonwebtoken to version 8.0.0

* Add babel-polyfill to tests for Node 4
daffl pushed a commit that referenced this pull request Aug 29, 2018
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

Successfully merging this pull request may close these issues.

Support HTTPS

1 participant