feat: init
This commit is contained in:
25
background/messages/ping.ts
Normal file
25
background/messages/ping.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import type { PlasmoMessaging } from "@plasmohq/messaging"
|
||||
|
||||
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler = async (req, res) => {
|
||||
const url = "http://192.168.31.245:8080?a=1"
|
||||
console.log('getmessage')
|
||||
const customHeaders = {
|
||||
"Content-Type": "application/json"
|
||||
}
|
||||
const data = {
|
||||
id: req.body.id
|
||||
}
|
||||
const message = await fetch(url, {
|
||||
method: "POST",
|
||||
headers: customHeaders,
|
||||
body: JSON.stringify(data)
|
||||
})
|
||||
res.send({
|
||||
message:'1112'
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
export default handler
|
||||
Reference in New Issue
Block a user