Unnode.js can easily be used to host multiple domains / websites on a single app instance.
You can also set a TLS certificate per-vhost. This uses SNI (Serve Name Indication) which is well supported by now.
Just configure your hostnames / domains in your unnode-server-config.js file:
module.exports = [
{
'vhost': ['my-site.org'],
'routes': [
{ ... },
{ ... }
},
{
// You can also use wildcards
'vhost': ['another-site.org', '*.another-site.org'],
'routes': [
{ ... },
{ ... }
},
{
// This will catch all other requests not matched to the above hostnames
'vhost': ['*'],
'routes': [
{ method: 'GET', path: '/', controller: 'site-controller#not_found' }
]
}
]
For a more comprehensive server config example, see https://github.com/rnurminen/my-websites/blob/master/config/unnode-server-config.js
See configuration for full details on the server config file.
Next: Logging