
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
```js const express=require("express"); const path=require("path"); const url=require("url"); const fs=require("fs"); const app=express(); //静态 app.use(express.static("public",{ index:"index.html" })); //接收post端口传过来的数据 app.use(express.json(
const express=require("express");
const path=require("path");
const url=require("url");
const fs=require("fs");
const app=express();
//静态
app.use(express.static("public",{
index:"index.html"
}));
//接收post端口传过来的数据
app.use(express.json());
//处理登录接口
app.post("/api/login",(req,res)=>{
//数据复制给body
let{user,pwd}=req.body;
//模块引进数据
let data=require("./mock/use.json");
//判断flag
let flag=data.some(item=>item.user===user&&item.pwd===pwd);
if(flag){
res.send("1");
}else{
res.send("0");
}
})
//数据查询接口
app.get("/api/list",(req,res)=>{
//读取数据转json赋值给data
let data=JSON.parse(fs.readFileSync("mock/list.json"));
//最后数组
res.send(data);
})
//删除数据
app.post("/api/delete",(req,res)=>{
//id进body里面
let{id}=req.body;
let data=JSON.parse(fs.readFileSync("mock/list.json"));
//数据过滤掉
data=data.filter(item=>item.id!==id);
fs.writeFile("./mock/list.json",JSON.stringify(data),(err)=>{
if(err){
res.send({
code:0,
mess:"删除失败",
})
return;
}
res.send({
code:1,
mess:"删除成功",
})
})
})
//添加数据
app.post("/api/add",(req,res)=>{
let data=JSON.parse(fs.readFileSync("mock/list.json"));
data.push(req.body);
fs.writeFileSync("mock/list.json",JSON.stringify(data));
res.send({code:1});
})
//模糊搜索数据
app.post("/api/search",(req,res)=>{
let {val}=req.body;
let data=JSON.parse(fs.readFileSync("mock/list.json"));
let arr=data.filter(item=>item.name.includes(val));
res.send(arr);
})
app.listen(5566,()=>console.log("服务器正在启动..."));
FAQs
```js const express=require("express"); const path=require("path"); const url=require("url"); const fs=require("fs"); const app=express(); //静态 app.use(express.static("public",{ index:"index.html" })); //接收post端口传过来的数据 app.use(express.json(
The npm package lianxi-wh receives a total of 5 weekly downloads. As such, lianxi-wh popularity was classified as not popular.
We found that lianxi-wh 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.