1 Star 0 Fork 57

md2pdf-ms/screenshot-api-server

forked from nop/screenshot-api-server 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
app.js 857 Bytes
一键复制 编辑 原始数据 按行查看 历史
nop 提交于 2021-03-24 01:18 . add static
var express = require('express');
var path = require('path');
//var cookieParser = require('cookie-parser');
var logger = require('morgan');
var apiRoute = require('./routes/api');
var downloadRoute = require('./routes/download');
var app = express();
app.use(logger('dev'));
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
//app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use('/static',express.static(path.join(__dirname,'static')));
app.all('*', (req, res, next) => {
res.header("Access-Control-Allow-Origin", "*");
res.header("Access-Control-Allow-Headers", "*");
res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS");
res.header("Server",'API');
next();
});
app.use('/api', apiRoute);
app.use('/download',downloadRoute);
module.exports = app;
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/md2pdf-ms/screenshot-api-server.git
git@gitee.com:md2pdf-ms/screenshot-api-server.git
md2pdf-ms
screenshot-api-server
screenshot-api-server
master

搜索帮助