1 Star 0 Fork 72

picoblue/led

forked from qwdingyu/led 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
server.js 732 Bytes
一键复制 编辑 原始数据 按行查看 历史
qwdingyu 提交于 2023-02-02 14:33 . init
const express = require('express')
const bodyParser = require('body-parser')
const cors = require('cors')
const app = express()
const PORT = process.env.PORT || 4444
var corsOptions = {
origin: `http://localhost:${PORT}`
}
app.use(cors(corsOptions))
// parse requests of content-type - application/json
app.use(bodyParser.json())
// parse requests of content-type - application/x-www-form-urlencoded
app.use(bodyParser.urlencoded({ extended: true }))
require('./src/models')
// simple route
app.get('/', (req, res) => {
res.json({ message: 'Welcome to led application.' })
})
require('./src/routers')(app)
// set port, listen for requests
app.listen(PORT, () => {
console.log(`Server is running on port ${PORT}.`)
})
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/picoblue/led.git
git@gitee.com:picoblue/led.git
picoblue
led
led
master

搜索帮助