This commit is contained in:
syuilo 2018-06-17 11:23:18 +09:00
parent d3bd27bc08
commit d310a7b8a5
2 changed files with 61 additions and 59 deletions

View file

@ -29,64 +29,6 @@
"@fortawesome/fontawesome-free-solid": "5.0.2", "@fortawesome/fontawesome-free-solid": "5.0.2",
"@koa/cors": "2.2.1", "@koa/cors": "2.2.1",
"@prezzemolo/rap": "0.1.2", "@prezzemolo/rap": "0.1.2",
"autwh": "0.1.0",
"bcryptjs": "2.4.3",
"cafy": "8.0.0",
"chalk": "2.4.1",
"crc-32": "1.2.0",
"debug": "3.1.0",
"deepcopy": "0.6.3",
"diskusage": "0.2.4",
"elasticsearch": "15.0.0",
"emojilib": "2.2.12",
"escape-regexp": "0.0.1",
"file-type": "8.0.0",
"gm": "1.23.1",
"http-signature": "1.2.0",
"is-root": "2.0.0",
"is-url": "1.2.4",
"js-yaml": "3.11.0",
"jsdom": "11.11.0",
"koa": "2.5.1",
"koa-bodyparser": "4.2.1",
"koa-compress": "3.0.0",
"koa-favicon": "2.0.1",
"koa-json-body": "5.3.0",
"koa-logger": "3.2.0",
"koa-mount": "3.0.0",
"koa-multer": "1.0.2",
"koa-router": "7.4.0",
"koa-send": "4.1.3",
"koa-slow": "2.1.0",
"koa-views": "6.1.4",
"kue": "0.11.6",
"mongodb": "3.0.10",
"monk": "6.0.6",
"ms": "2.1.1",
"nopt": "4.0.1",
"os-utils": "0.0.14",
"parse5": "5.0.0",
"prominence": "0.2.0",
"promise-sequential": "1.1.1",
"punycode": "2.1.1",
"qrcode": "1.2.0",
"ratelimiter": "3.0.3",
"recaptcha-promise": "0.1.3",
"reconnecting-websocket": "3.2.2",
"redis": "2.8.0",
"request": "2.87.0",
"request-promise-native": "1.0.5",
"rndstr": "1.0.0",
"speakeasy": "2.0.0",
"summaly": "2.0.6",
"tcp-port-used": "0.1.2",
"tmp": "0.0.33",
"uuid": "3.2.1",
"web-push": "3.3.1",
"webfinger.js": "2.6.6",
"websocket": "1.0.26",
"ws": "5.2.0",
"xev": "2.0.1",
"@prezzemolo/zip": "0.0.3", "@prezzemolo/zip": "0.0.3",
"@types/bcryptjs": "2.4.1", "@types/bcryptjs": "2.4.1",
"@types/debug": "0.0.30", "@types/debug": "0.0.30",
@ -142,17 +84,30 @@
"@types/ws": "5.1.1", "@types/ws": "5.1.1",
"animejs": "2.2.0", "animejs": "2.2.0",
"autosize": "4.0.2", "autosize": "4.0.2",
"autwh": "0.1.0",
"bcryptjs": "2.4.3",
"bootstrap-vue": "2.0.0-rc.6", "bootstrap-vue": "2.0.0-rc.6",
"cafy": "8.0.0",
"chalk": "2.4.1",
"crc-32": "1.2.0",
"css-loader": "0.28.11", "css-loader": "0.28.11",
"debug": "3.1.0",
"deep-equal": "1.0.1", "deep-equal": "1.0.1",
"deepcopy": "0.6.3",
"diskusage": "0.2.4",
"dompurify": "1.0.4", "dompurify": "1.0.4",
"elasticsearch": "15.0.0",
"element-ui": "2.3.9", "element-ui": "2.3.9",
"emojilib": "2.2.12",
"escape-regexp": "0.0.1",
"eslint": "4.19.1", "eslint": "4.19.1",
"eslint-plugin-vue": "4.5.0", "eslint-plugin-vue": "4.5.0",
"eventemitter3": "3.1.0", "eventemitter3": "3.1.0",
"exif-js": "2.3.0", "exif-js": "2.3.0",
"file-loader": "1.1.11", "file-loader": "1.1.11",
"file-type": "8.0.0",
"fuckadblock": "3.2.1", "fuckadblock": "3.2.1",
"gm": "1.23.1",
"gulp": "3.9.1", "gulp": "3.9.1",
"gulp-cssnano": "2.1.3", "gulp-cssnano": "2.1.3",
"gulp-htmlmin": "4.0.0", "gulp-htmlmin": "4.0.0",
@ -170,32 +125,71 @@
"hard-source-webpack-plugin": "0.6.10", "hard-source-webpack-plugin": "0.6.10",
"highlight.js": "9.12.0", "highlight.js": "9.12.0",
"html-minifier": "3.5.16", "html-minifier": "3.5.16",
"http-signature": "1.2.0",
"inquirer": "5.2.0", "inquirer": "5.2.0",
"is-root": "2.0.0",
"is-url": "1.2.4",
"js-yaml": "3.11.0",
"jsdom": "11.11.0",
"koa": "2.5.1",
"koa-bodyparser": "4.2.1",
"koa-compress": "3.0.0",
"koa-favicon": "2.0.1",
"koa-json-body": "5.3.0",
"koa-logger": "3.2.0",
"koa-mount": "3.0.0",
"koa-multer": "1.0.2",
"koa-router": "7.4.0",
"koa-send": "4.1.3",
"koa-slow": "2.1.0",
"koa-views": "6.1.4",
"kue": "0.11.6",
"license-checker": "20.0.0", "license-checker": "20.0.0",
"loader-utils": "1.1.0", "loader-utils": "1.1.0",
"mecab-async": "0.1.2", "mecab-async": "0.1.2",
"mkdirp": "0.5.1", "mkdirp": "0.5.1",
"mocha": "5.2.0", "mocha": "5.2.0",
"moji": "0.5.1", "moji": "0.5.1",
"mongodb": "3.0.10",
"monk": "6.0.6",
"ms": "2.1.1",
"nan": "2.10.0", "nan": "2.10.0",
"node-sass": "4.9.0", "node-sass": "4.9.0",
"node-sass-json-importer": "3.2.0", "node-sass-json-importer": "3.2.0",
"nopt": "4.0.1",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"object-assign-deep": "0.4.0", "object-assign-deep": "0.4.0",
"on-build-webpack": "0.1.0", "on-build-webpack": "0.1.0",
"os-utils": "0.0.14",
"parse5": "5.0.0",
"progress-bar-webpack-plugin": "1.11.0", "progress-bar-webpack-plugin": "1.11.0",
"prominence": "0.2.0",
"promise-sequential": "1.1.1",
"pug": "2.0.3", "pug": "2.0.3",
"punycode": "2.1.1",
"qrcode": "1.2.0",
"ratelimiter": "3.0.3",
"recaptcha-promise": "0.1.3",
"reconnecting-websocket": "3.2.2",
"redis": "2.8.0",
"request": "2.87.0",
"request-promise-native": "1.0.5",
"rimraf": "2.6.2", "rimraf": "2.6.2",
"rndstr": "1.0.0",
"s-age": "1.1.2", "s-age": "1.1.2",
"sass-loader": "7.0.1", "sass-loader": "7.0.1",
"seedrandom": "2.4.3", "seedrandom": "2.4.3",
"single-line-log": "1.1.2", "single-line-log": "1.1.2",
"speakeasy": "2.0.0",
"style-loader": "0.21.0", "style-loader": "0.21.0",
"stylus": "0.54.5", "stylus": "0.54.5",
"stylus-loader": "3.0.2", "stylus-loader": "3.0.2",
"summaly": "2.0.6",
"swagger-jsdoc": "1.9.7", "swagger-jsdoc": "1.9.7",
"syuilo-password-strength": "0.0.1", "syuilo-password-strength": "0.0.1",
"tcp-port-used": "0.1.2",
"textarea-caret": "3.1.0", "textarea-caret": "3.1.0",
"tmp": "0.0.33",
"ts-loader": "4.3.0", "ts-loader": "4.3.0",
"ts-node": "6.0.4", "ts-node": "6.0.4",
"tslint": "5.10.0", "tslint": "5.10.0",
@ -203,6 +197,7 @@
"typescript-eslint-parser": "15.0.0", "typescript-eslint-parser": "15.0.0",
"uglify-es": "3.3.9", "uglify-es": "3.3.9",
"url-loader": "1.0.1", "url-loader": "1.0.1",
"uuid": "3.2.1",
"v-animate-css": "0.0.2", "v-animate-css": "0.0.2",
"vue": "2.5.16", "vue": "2.5.16",
"vue-cropperjs": "2.2.0", "vue-cropperjs": "2.2.0",
@ -214,7 +209,12 @@
"vuedraggable": "2.16.0", "vuedraggable": "2.16.0",
"vuex": "3.0.1", "vuex": "3.0.1",
"vuex-persistedstate": "^2.5.4", "vuex-persistedstate": "^2.5.4",
"web-push": "3.3.1",
"webfinger.js": "2.6.6",
"webpack": "4.9.1", "webpack": "4.9.1",
"webpack-cli": "2.1.4" "webpack-cli": "2.1.4",
"websocket": "1.0.26",
"ws": "5.2.0",
"xev": "2.0.1"
} }
} }

View file

@ -6,6 +6,7 @@ import * as Koa from 'koa';
import * as Router from 'koa-router'; import * as Router from 'koa-router';
import * as multer from 'koa-multer'; import * as multer from 'koa-multer';
import * as bodyParser from 'koa-bodyparser'; import * as bodyParser from 'koa-bodyparser';
const cors = require('@koa/cors');
import endpoints from './endpoints'; import endpoints from './endpoints';
@ -13,6 +14,7 @@ const handler = require('./api-handler').default;
// Init app // Init app
const app = new Koa(); const app = new Koa();
app.use(cors());
app.use(bodyParser({ app.use(bodyParser({
// リクエストが multipart/form-data でない限りはJSONだと見なす // リクエストが multipart/form-data でない限りはJSONだと見なす
detectJSON: ctx => !ctx.is('multipart/form-data') detectJSON: ctx => !ctx.is('multipart/form-data')