Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
server-1min
Advanced tools
Launch node server in 1 minute.
Start server with custom routing rules
npx server-1min -f $(pwd)/routes.js
Start server with specific port
npx server-1min -p 8080
Web Server
const path = require('path');
const express = require('express');
module.exports = [{
method: 'USE',
path: '/static',
callbacks: [
express.static(path.resolve(__dirname, 'public/static')),
],
}, {
method: 'GET',
path: '/',
callbacks: [
express.static(path.resolve(__dirname, 'public')),
],
}];
Webhook inspector
const util = require('util');
const bodyParser = require('body-parser');
const jsonParser = bodyParser.json();
module.exports = [{
method: 'POST',
path: '/webhook',
callbacks: [
jsonParser,
(req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
next();
},
(req, res) => {
console.log(util.inspect(req.body, false, null, true));
res.status(200).send(req.body);
},
],
}];
Single file upload
const path = require('path');
const fileUpload = require('express-fileupload');
module.exports = [{
method: 'POST',
path: '/upload',
callbacks: [
fileUpload(),
(req, res, next) => {
res.header('Access-Control-Allow-Origin', '*');
res.header('Access-Control-Allow-Headers', 'Origin, X-Requested-With, Content-Type, Accept');
next();
},
(req, res) => {
if (!req.files) {
return res.status(400).send('No files were uploaded.');
}
const { file } = req.files;
file.mv(path.resolve(__dirname, file.name), (err) => {
if (err)
return res.status(500).send(err);
res.send('File uploaded!');
});
},
],
}];
FAQs
Launch node server in 1 minute.
We found that server-1min 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.