Created
May 20, 2021 10:46
-
-
Save lanma/8656bb29f2d43fd6d32443574f554884 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const parser = require('ua-parser-js') | |
const app = express() | |
const port = 3000 | |
const code = '111121314151617'//場所代碼 | |
var count=0//人次 | |
app.get('/', (req, res) => { | |
let ua = parser(req.headers['user-agent']) | |
let sep = ua.os.name === 'iOS'? '&' : '?' | |
count = count+1 | |
console.log("==人數:",count,'本次用戶OS為:',ua.os.name) | |
res.redirect(`sms:1922${sep}body=場所代碼:${code} 本簡訊是簡訊實聯制發送,限防疫目的使用(人次${count})`) | |
}) | |
app.listen(port, () => { | |
console.log(`Example app listening at http://localhost:${port}`) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment