
Research
/Security News
Critical Vulnerability in NestJS Devtools: Localhost RCE via Sandbox Escape
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
vite-plugin-express
Advanced tools
> A [vite](https://vitejs.dev/) plugin to integrate the express server into vite dev server.
A vite plugin to integrate the express server into vite dev server.
resolve
and other configs in vite.Install vite and this plugin with your favorite package manager, here use npm as example:
npm install vite vite-plugin-express -D
Create a vite.config.ts
file in your project root to config vite to actually use this plugin:
import { defineConfig } from 'vite';
import express from 'vite-plugin-express';
export default defineConfig({
plugins: [
react(),
express({
// the server files export a middleware as default
// this config can be a glob
middlewareFiles: './server',
}),
],
resolve: {
alias: {
// you can use this alias in your server code as well
'@': './src',
},
},
});
Export a middleware as default in your every server files.
// /server/account.ts
import { faker } from '@faker-js/faker';
import express, { Request, Router } from 'express';
import {
Gender,
} from '@/constants/gender';
const router = Router();
const { name } = faker;
router.get('/api/account', (request, response) => {
response.status(200).send({
name: `${name.firstName()} ${name.lastName()}`,
gender: Gender.Male,
});
});
export default router;
src/**/*.js
— matches all files in the src
directory (any level of nesting) that have the .js
extension.src
or src/*.??
— matches all files in the src
directory (only first level of nesting) that have a two-character extension.file-[01].js
— matches files: file-0.js
, file-1.js
./api
res.header('Cache-Control', 'private, no-cache, no-store, must-revalidate');
res.header('Expires', '-1');
res.header('Pragma', 'no-cache');
FAQs
> A [vite](https://vitejs.dev/) plugin to integrate the express server into vite dev server.
The npm package vite-plugin-express receives a total of 101 weekly downloads. As such, vite-plugin-express popularity was classified as not popular.
We found that vite-plugin-express demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
A flawed sandbox in @nestjs/devtools-integration lets attackers run code on your machine via CSRF, leading to full Remote Code Execution (RCE).
Product
Customize license detection with Socket’s new license overlays: gain control, reduce noise, and handle edge cases with precision.
Product
Socket now supports Rust and Cargo, offering package search for all users and experimental SBOM generation for enterprise projects.