
Product
Announcing Socket Fix 2.0
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
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.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.