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"],
|
"src": global["__src"],
|
||||||
|
|
||||||
// expose shared resources
|
// expose shared resources
|
||||||
"@db_models": path.resolve(__dirname, "db_models"),
|
"@db": path.resolve(process.cwd(), "db_models"),
|
||||||
"@shared-utils": path.resolve(__dirname, "utils"),
|
"@db_models": path.resolve(process.cwd(), "db_models"),
|
||||||
"@shared-classes": path.resolve(__dirname, "classes"),
|
"@shared-utils": path.resolve(process.cwd(), "utils"),
|
||||||
"@shared-lib": path.resolve(__dirname, "lib"),
|
"@shared-classes": path.resolve(process.cwd(), "classes"),
|
||||||
"@shared-middlewares": path.resolve(__dirname, "middlewares"),
|
"@shared-lib": path.resolve(process.cwd(), "lib"),
|
||||||
|
"@shared-middlewares": path.resolve(process.cwd(), "middlewares"),
|
||||||
|
|
||||||
// expose internal resources
|
// expose internal resources
|
||||||
"@lib": path.resolve(global["__src"], "lib"),
|
"@lib": path.resolve(global["__src"], "lib"),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "linebridge",
|
"name": "linebridge",
|
||||||
"version": "0.20.0",
|
"version": "0.19.4",
|
||||||
"description": "API Framework for RageStudio backends",
|
"description": "API Framework for RageStudio backends",
|
||||||
"author": "RageStudio",
|
"author": "RageStudio",
|
||||||
"main": "./dist/client/index.js",
|
"main": "./dist/client/index.js",
|
||||||
@ -18,8 +18,7 @@
|
|||||||
"files": [
|
"files": [
|
||||||
"src/**/**",
|
"src/**/**",
|
||||||
"dist/**/**",
|
"dist/**/**",
|
||||||
"./package.json",
|
"./package.json"
|
||||||
"boot"
|
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -38,6 +38,14 @@ export default class Engine {
|
|||||||
|
|
||||||
// register body parser
|
// register body parser
|
||||||
await this.app.use(async (req, res, next) => {
|
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"]) {
|
||||||
if (!req.headers["content-type"].startsWith("multipart/form-data")) {
|
if (!req.headers["content-type"].startsWith("multipart/form-data")) {
|
||||||
req.body = await req.urlencoded()
|
req.body = await req.urlencoded()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user