diff options
-rw-r--r-- | app.ts | 2 | ||||
-rw-r--r-- | package-lock.json | 38 | ||||
-rw-r--r-- | package.json | 15 |
3 files changed, 51 insertions, 4 deletions
@@ -2,6 +2,7 @@ import feathers from '@feathersjs/feathers'; import express from '@feathersjs/express'; import socketio from '@feathersjs/socketio'; import '@feathersjs/transport-commons'; +import cors from 'cors'; import services from './services'; @@ -14,6 +15,7 @@ app.use(express.static(__dirname)); app.configure(express.rest()); app.configure(socketio()); app.use(express.errorHandler()); +app.use(cors()); app.configure(services); diff --git a/package-lock.json b/package-lock.json index ab94251..35cc880 100644 --- a/package-lock.json +++ b/package-lock.json @@ -76,6 +76,12 @@ "radix-router": "^3.0.1" } }, + "@types/bluebird": { + "version": "3.5.32", + "resolved": "https://registry.npmjs.org/@types/bluebird/-/bluebird-3.5.32.tgz", + "integrity": "sha512-dIOxFfI0C+jz89g6lQ+TqhGgPQ0MxSnh/E4xuC0blhFtyW269+mPG5QeLgbdwst/LvdP8o1y0o/Gz5EHXLec/g==", + "dev": true + }, "@types/body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.0.tgz", @@ -89,6 +95,7 @@ "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.2.tgz", "integrity": "sha512-+uWmsejEHfmSjyyM/LkrP0orfE2m5Mx9Xel4tXNeqi1ldK5XMQcDsFkBmLDtuyKUbxj2jGDo0H240fbCRJZo7Q==", + "dev": true, "requires": { "@types/node": "*" } @@ -101,6 +108,15 @@ "@types/node": "*" } }, + "@types/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-invOmosX0DqbpA+cE2yoHGUlF/blyf7nB0OGYBBiH27crcVm5NmFaZkLP4Ta1hGaesckCi5lVLlydNJCxkTOSg==", + "dev": true, + "requires": { + "@types/express": "*" + } + }, "@types/engine.io": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/@types/engine.io/-/engine.io-3.1.4.tgz", @@ -130,6 +146,12 @@ "@types/range-parser": "*" } }, + "@types/lodash": { + "version": "4.14.155", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.155.tgz", + "integrity": "sha512-vEcX7S7aPhsBCivxMwAANQburHBtfN9RdyXFk84IJmu2Z4Hkg1tOFgaslRiEqqvoLtbCBi6ika1EMspE+NZ9Lg==", + "dev": true + }, "@types/mime": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-2.0.2.tgz", @@ -139,6 +161,7 @@ "version": "3.5.20", "resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.5.20.tgz", "integrity": "sha512-BN0wJn670DkivxiP7ZW0InX4qBtX01qITaucD+3A+sTgPQo4XUYay0Y+sGM4MJ9OyKDRlb3RQuVAlyeWzl/NoA==", + "dev": true, "requires": { "@types/bson": "*", "@types/node": "*" @@ -148,6 +171,7 @@ "version": "5.7.23", "resolved": "https://registry.npmjs.org/@types/mongoose/-/mongoose-5.7.23.tgz", "integrity": "sha512-Yh1vXr+Y+ro887sma0kihtvbazy3prC+gjT0FJZ/Kt6rOQoHnCRm8oiOvDWGncP3YVXAoCj4YeNLp7moIyBKIQ==", + "dev": true, "requires": { "@types/mongodb": "*", "@types/node": "*" @@ -347,6 +371,15 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "cors": { + "version": "2.8.5", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", + "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "requires": { + "object-assign": "^4", + "vary": "^1" + } + }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", @@ -741,6 +774,11 @@ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" + }, "object-component": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", diff --git a/package.json b/package.json index 6e1f213..24616e9 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { - "name": "@oneflow/which-api", + "name": "which-api", "version": "1.0.0", - "main": "index.js", + "main": "index.ts", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -13,8 +13,9 @@ "@feathersjs/feathers": "^4.5.3", "@feathersjs/socketio": "^4.5.4", "@feathersjs/transport-commons": "^4.5.3", - "@types/mongoose": "^5.7.23", + "cors": "^2.8.5", "feathers-mongoose": "^8.3.0", + "lodash": "^4.17.15", "mongoose": "^5.9.18" }, "repository": { @@ -25,5 +26,11 @@ "url": "https://github.com/eug-vs/which-api/issues" }, "homepage": "https://github.com/eug-vs/which-api#readme", - "description": "" + "description": "", + "devDependencies": { + "@types/bluebird": "^3.5.32", + "@types/cors": "^2.8.6", + "@types/lodash": "^4.14.155", + "@types/mongoose": "^5.7.23" + } } |