Core Features (v9.3.4)
Novaxjs2 v9.3.4 is packed with powerful features designed to make web development faster, simpler, and more efficient. Here's a comprehensive overview of what the framework offers.
Advanced Routing System
- RESTful route definitions - GET, POST, PUT, DELETE methods
- Dynamic path parameters -
/users/:idstyle routes - Query parameter parsing - Automatic
req.queryobject - Route groups - Organize routes with common prefixes
- Regular expression routes - Advanced pattern matching
- Middleware per route - Apply middleware to specific routes
- Router modules -
app.useRouter()for modular apps
Middleware System
- Standard middleware chain - Sequential request processing
- Error handling middleware - Centralized error management
- Built-in static file middleware - Automatic static asset serving
- Async middleware support - Promise-based middleware functions
- Route-specific middleware - Apply middleware to route groups
- Custom middleware creation - Extend functionality easily
Templating Engine
- Built-in Novax template engine - No external dependencies
- Dual-mode templates - HTML syntax or JavaScript functions
- New @ syntax - Cleaner template expressions
- Conditionals -
@if, @else, @elif, @end - Loops -
@eachwith index support - Variable interpolation -
@variableand@{expression} - Custom helpers - Register helper functions
- Third-party engine support - EJS, Pug, Handlebars integration
- Template includes -
@include('template') - Variable declaration -
@varfor template variables
File Handling
- Static file serving - Automatic MIME type detection
- File uploads with limits - Size, type, and quantity restrictions
- Multipart form parsing - Automatic
req.filesobject - 80+ MIME type support - Comprehensive file type detection
- Direct file responses -
sendFile()method - File management utilities - Upload cleanup and stream handling
- Security validation - File type and size validation
Security Features
- Configurable CORS - Cross-origin resource sharing
- Automatic body parsing - JSON and form data parsing
- IP address detection -
req.ipwith proxy support - File upload protections - Size and type restrictions
- XSS protection - Automatic content escaping in templates
- Header security - Custom security headers
- Error sanitization - Production error message hiding
- Cookie security - HTTP-only, secure cookies support
Performance Optimizations
- Lightweight core - Minimal memory footprint
- Optimized routing - Fast route matching with regex
- Built-in minification - HTML, CSS, and JS minification
- Efficient middleware - Low-overhead middleware system
- Streaming support - File and response streaming
- Memory management - Efficient buffer handling
- Connection handling - Keep-alive and timeout management
- Template caching - Improved rendering performance
Customization & Extensibility
- Global CSS injection - Application-wide styles
- Global JavaScript injection - Client-side scripts
- Custom error pages - Status code specific error handling
- Response helpers -
res.json(),res.send() - Plugin system - Extend framework functionality
- Configuration system - App-wide settings management
- Helper functions - Custom template helpers
- Cookie management -
res.cookie()andres.clearCookie()
Plugin System
- Extensible architecture - Add new methods and features
- Middleware injection - Plugin-provided middleware
- Route registration - Plugins can define routes
- Configuration management - Plugin-specific settings
- Lifecycle hooks - Plugin initialization events
- Dependency management - Plugin interoperability
- Method injection - Add custom methods to app instance
Error Handling
- Custom error pages - Status-specific error responses
- Global error handler - Centralized exception handling
- Async error support - Promise rejection handling
- Development mode - Detailed error messages
- Production mode - User-friendly error pages
- Error logging - Structured error information
- Error transformation - Custom error classes and formatting
API Features
- RESTful API support - Resource-based routing
- JSON responses - Automatic serialization
- Status code helpers -
res.status()method - Redirect support -
res.redirect()method - Header manipulation -
res.set()method - Request information - URL, protocol, IP address data
- Cookie support - Automatic cookie parsing and setting
Version 9.3.4 Specific Features
- Enhanced Templating Engine - New
@syntax for cleaner templates - Cookie Support - Built-in cookie parsing and management
- Router Modules -
app.useRouter()for better code organization - Template Includes -
@include()directive for partials - Variable Declaration -
@varfor template-scoped variables - Improved Error Handling - Better stack traces and error messages
- Enhanced Plugin System - More integration points and options
- Performance Optimizations - Faster routing and template rendering
- Security Enhancements - Additional security headers and cookie options
- Extended File Type Support - Additional MIME type recognitions
- Better Documentation - Comprehensive guides and examples