mirror of
https://github.com/ragestudio/linebridge.git
synced 2025-06-09 10:34:17 +00:00
Merge branch 'master' of https://github.com/ragestudio/linebridge
This commit is contained in:
commit
b6abc59f44
11
bin/boot.js
11
bin/boot.js
@ -26,11 +26,12 @@ global["aliases"] = {
|
||||
"src": global["__src"],
|
||||
|
||||
// expose shared resources
|
||||
"@db_models": path.resolve(__dirname, "db_models"),
|
||||
"@shared-utils": path.resolve(__dirname, "utils"),
|
||||
"@shared-classes": path.resolve(__dirname, "classes"),
|
||||
"@shared-lib": path.resolve(__dirname, "lib"),
|
||||
"@shared-middlewares": path.resolve(__dirname, "middlewares"),
|
||||
"@db": path.resolve(process.cwd(), "db_models"),
|
||||
"@db_models": path.resolve(process.cwd(), "db_models"),
|
||||
"@shared-utils": path.resolve(process.cwd(), "utils"),
|
||||
"@shared-classes": path.resolve(process.cwd(), "classes"),
|
||||
"@shared-lib": path.resolve(process.cwd(), "lib"),
|
||||
"@shared-middlewares": path.resolve(process.cwd(), "middlewares"),
|
||||
|
||||
// expose internal resources
|
||||
"@lib": path.resolve(global["__src"], "lib"),
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "linebridge",
|
||||
"version": "0.20.0",
|
||||
"version": "0.19.4",
|
||||
"description": "API Framework for RageStudio backends",
|
||||
"author": "RageStudio",
|
||||
"main": "./dist/client/index.js",
|
||||
@ -18,8 +18,7 @@
|
||||
"files": [
|
||||
"src/**/**",
|
||||
"dist/**/**",
|
||||
"./package.json",
|
||||
"boot"
|
||||
"./package.json"
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
@ -38,6 +38,14 @@ export default class Engine {
|
||||
|
||||
// register body parser
|
||||
await this.app.use(async (req, res, next) => {
|
||||
if (req.method === "OPTIONS") {
|
||||
res.setHeader("Access-Control-Allow-Methods", "*")
|
||||
res.setHeader("Access-Control-Allow-Origin", "*")
|
||||
res.setHeader("Access-Control-Allow-Headers", "*")
|
||||
|
||||
return res.status(204).end()
|
||||
}
|
||||
|
||||
if (req.headers["content-type"]) {
|
||||
if (!req.headers["content-type"].startsWith("multipart/form-data")) {
|
||||
req.body = await req.urlencoded()
|
||||
|
Loading…
x
Reference in New Issue
Block a user