gitpush
This commit is contained in:
parent
da3034d984
commit
ba6f732dbb
@ -10,10 +10,14 @@ const app = express()
|
||||
const server = app.listen(port, host, () => console.log(`rpi sense hat server is running at port http://${host}:${port}`))
|
||||
const io = socketio(server)
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.status(200).send('RPi Sense HAT API is ON :)')
|
||||
app.use((req, res) => {
|
||||
res.setHeader('Access-Control-Allow-Origin', '*')
|
||||
res.setHeader('Access-Control-Allow-Methods', 'HEAD,GET,POST,OPTIONS,PATCH,PUT,DELETE')
|
||||
res.setHeader('Access-Control-Allow-Headers', 'Origin,X-Requested-With,Authorization,Content-Type,Accept,Z-Key')
|
||||
})
|
||||
|
||||
app.get('/', (req, res) => res.sendStatus(200))
|
||||
|
||||
// Sense HAT 初始化
|
||||
sense.lowLight = true
|
||||
sense.setRotation(180)
|
||||
|
Loading…
Reference in New Issue
Block a user