@yasui/cors
v1.1.0
Published
CORS middleware for YasuiJS
Maintainers
Readme
@yasui/cors
Production-ready CORS middleware for YasuiJS
Features
- ✅ Origin validation (exact match, wildcard, regex patterns)
- ✅ Preflight OPTIONS handling
- ✅ Credentials support (cookies, auth headers)
- ✅ Cache optimization (Vary header)
- ✅ Private Network Access (CORS-RFC1918)
- ✅ Security-first defaults
Installation
npm install @yasui/corsQuick Start
import yasui from 'yasui';
import { cors } from '@yasui/cors';
yasui.createServer({
middlewares: [
cors({
origins: ['https://app.example.com'],
credentials: true
})
],
controllers: [UserController]
});📖 Documentation
License
This project is licensed under the GNU Affero General Public License v3.0 or later. See the LICENSE file for details.
