当前仓库属于关闭状态,部分功能使用受限,详情请查阅 仓库状态说明
1 Star 0 Fork 0

青ツ玉/DataVisualization
关闭

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
app.js 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
青ツ玉 提交于 2018-05-17 23:43 . finish line pie bar scatter radar
const path = require('path');
const fs = require('fs');
const express = require('express');
const port = process.env.PORT || 2600;
const app = new express();
const bodyParser = require("body-parser");
const multer = require("multer");
const db = require('./supporter/db/connect');
const userroute=require("./supporter/modules/users/users.route");
const chartsroute=require("./supporter/modules/charts/charts.route");
const teamsroute=require("./supporter/modules/teams/teams.route");
const newsroute=require("./supporter/modules/news/news.route");
const shareroute = require('./supporter/modules/share/share.route');
app.use(bodyParser.json({limit: '50mb'}));
app.use(bodyParser.urlencoded({limit: '50mb', extended: true}));
// app.use(bodyParser.json());//for parsing application/json
// app.use(bodyParser.urlencoded({ extended: true }));//for parsing application/x-www-form-urlencoded
//配置默认静态路径与页面路由
app.use(express.static('public'));
app.get('/', (req, res) => {
res.sendFile(path.join(__dirname, '', 'index.html'));
});
app.get('/login', (req, res) => {
res.sendFile(path.join(__dirname, '', 'login.html'));
});
userroute(app);
chartsroute(app);
teamsroute(app);
newsroute(app);
shareroute(app);
//启动服务器,连接数据库
app.listen(port, (error) => {
if (error) {
console.error(error);
} else {
db.start();
console.info('==> Listening on port %s. Open up http://localhost:%s/ in your browser.', port, port);
}
});
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wuchunling/DataVisualization.git
[email protected]:wuchunling/DataVisualization.git
wuchunling
DataVisualization
DataVisualization
master

搜索帮助