novax-submanager
v2.0.0
Published
Subdomain management plugin for NovaJS framework
Maintainers
Readme
Novax Submanager
This plugin allows you to create and manage multiple subdomain applications within a single NovaJS instance, with complete isolation and shared configuration capabilities.
Features
- Isolated Sub-applications
- Each subdomain gets its own Nova instance with complete route isolation.
- Shared Configuration
- Middlewares, error handlers, and settings are automatically copied to all sub-apps.
Installation
npm install novax-submanagerUsage
const Nova = require('novaxjs2');
const submanager = require('novax-submanager');
const app = new Nova();
// Configure subdomains
app.usePlugin(submanager, {
subdomains: ['admin', 'api', 'blog']
});
// Main app routes
app.get('/', (req, res) => {
res.send('Main Application');
});
// Access subdomain apps
app.sub('admin').get('/', (req, res) => {
res.send('Admin Dashboard');
});
app.sub('api').get('/users', (req, res) => {
res.json({ users: ['Alice', 'Bob', 'Charlie'] });
});
app.at(3000);
## License
This project is licensed under the MIT License.