Installation
Get started with Novaxjs2 in seconds. The framework is lightweight, easy to install, and requires minimal configuration.
Prerequisites
Before installing Novaxjs2, make sure you have:
- Node.js version 12.0 or higher
- npm or yarn package manager
- Basic knowledge of JavaScript and Node.js
Installation Methods
npm
Yarn
npm install novaxjs2 yarn add novaxjs2 Quick Start
Create a simple server to test your installation:
// app.js
const Nova = require('novaxjs2');
const app = new Nova();
// Basic route
app.get('/', (req, res) => {
return '<h1>Hello Novaxjs2!</h1>';
});
// Start server
app.at(3000, () => {
console.log('Server running on http://localhost:3000');
}); Run your server:
node app.js Initialization Options
You can customize Novaxjs2 with initialization options:
const app = new Nova();
app.init({
staticPath: 'public', // Serve static files from 'public' directory
minifier: true, // Enable HTML/CSS/JS minification (default: true)
fileConfig: { // File upload configuration
maxSize: 10, // Max file size in MB
allowedTypes: ['image/jpeg', 'image/png'],
maxFiles: 5,
keepOriginalName: false
}
}); Project Structure
A typical Novaxjs2 project structure:
my-app/
├── app.js # Main application file
├── package.json
├── views/ # Template files (optional)
│ ├── home.html
│ └── layout.html
├── public/ # Static assets (optional)
│ ├── css/
│ ├── js/
│ └── images/
└── uploads/ # Uploaded files (auto-created) Version Compatibility
| Novaxjs2 Version | Node.js Version | Features |
|---|---|---|
| 8.x | 12.0+ | Full feature set with middleware, templating, file uploads |
| 7.x | 10.0+ | Basic routing and static file serving |