
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 app=express(); const fs=require("fs"); const path=require("path"); const url=require("url"); app.use(express.static("public",{ index:"res.html" })) app.use(express.json()); //登录 app.post("/api/l
const express=require("express");
const app=express();
const fs=require("fs");
const path=require("path");
const url=require("url");
app.use(express.static("public",{
index:"res.html"
}))
app.use(express.json());
//登录
app.post("/api/login",(req,res)=>{
let{user,pwd}=req.body;
let data=JSON.parse(fs.readFileSync("./mock/use.json"));
let flag=data.find(item=>item.user===user&&item.pwd===pwd);
if(flag){
res.send({
code: 1,
mess: "登录成功",
id: flag.id,
})
}else{
res.send("0");
}
})
//注册
app.post("/api/res",(req,res)=>{
let{user,pwd}=req.body;
let data=JSON.parse(fs.readFileSync("./mock/use.json"));
let flag=data.find(item=>item.user===user&&item.pwd===pwd);
if(flag){
res.send("1");
}else{
res.send("0");
}
})
//添加数据
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.get("/api/list",(req,res)=>{
let data=JSON.parse(fs.readFileSync("./mock/list.json"));
res.send(data);
})
//删除数据
app.post("/api/del",(req,res)=>{
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/lis",(req,res)=>{
let {index,num}=req.body;
let data=JSON.parse(fs.readFileSync("./mock/list.json"));
let len=Math.ceil(data.length/num);
let star=index*num;
let end=(index+1)*num;
res.send({
code:1,
maxlen:len,
arr:data.slice(star,end),
});
})
app.listen(5577,()=>console.log("服务器正在启动"));
FAQs
```js const express=require("express"); const app=express(); const fs=require("fs"); const path=require("path"); const url=require("url"); app.use(express.static("public",{ index:"res.html" })) app.use(express.json()); //登录 app.post("/api/l
The npm package lianxi-fen receives a total of 2 weekly downloads. As such, lianxi-fen popularity was classified as not popular.
We found that lianxi-fen 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.