Tag: 量angular器

Api调用MEAN4 +

所以我在一个平均的堆栈应用程序工作,但我只是没有得到我的api的权利..唯一的作品是GET! 我的post似乎并没有工作,我想我的语法错了,但我只是没有在互联网上find正确的。 //GET router.get('/employees', (req, res) => { connection((db) => { db.collection('employees') .find() .toArray() .then((employees) => { response.data = employees; res.json(response); }) .catch((err) => { sendError(err, res); }); }); }); // POST router.post('/employees', (req, res) => { const employees = { name: req.body.name, age: req.body.age , wage: req.body.wage , place: req.body.place }; db.collection('employees').insert(employees, (err, result) […]

使用ElementArrayFinder.filter()和async / await

Webdriver的Control Flow启用时,我一直使用下面的函数来过滤元素数组: filterElementsByText (elemList, comparator, locator) { return elemList.filter((elem) => { let searchTarget = locator ? elem.element(locator) : elem return searchTarget.getText().then((text) => text === comparator) }) } 我现在试图迁移我的回购使用async / await需要closures控制stream。 这个转换大部分都是成功的,但是我在上面的函数中遇到了麻烦。 间歇性地,我看到这个错误: 失败:java.net.ConnectException:连接被拒绝:连接 我能够用我写的一个testing用例https://angularjs.org来重现这个问题,虽然它发生的频率比我自己的应用要高得多。 let todoList = element.all(by.repeater('todo in todoList.todos')) let todoText = element(by.model('todoList.todoText')) let todoSubmit = element(by.css('[value="add"]')) let addItem = async (itemLabel = 'write […]

Angular Cli代理在一个env中工作,但在另一个环境中返回ECONNRESET

第一次在这里提出问题,所以请让我知道,如果我错过了任何最佳做法。 我正在使用一个使用代理的Angular 4应用程序来简化应用程序的前端和后端之间的通信。 代理设置如下: { "/api": { "target": "http://localhost:9000", "secure": false }, "/auth": { "target": "http://localhost:9000", "secure": false } } 在我的主电脑中,当我运行将调用代理的应用程序的一部分,我得到以下错误。 [HPM] Error occurred while trying to proxy request /auth/google from localhost:4200 to http://localhost:9000 (ECONNRESET) (https://nodejs.org/api/errors.html#errors_common_system_errors) 铬控制台显示504错误。 我用来运行所有服务器的命令 concurrently \"mongod\" \"ng serve -pc proxy.conf.json –open\" \"tsc -w -p server\" \"nodemon dist/server/app.js\" 当应用程序正在build立时,我可以看到程序已经build立了代理,但同样的错误仍然发生。 [1] [HPM] Proxy […]

在angular2中链接sails.io.js

我无法使用angular2使用sails.io.js。 我使用angular2-sails库。 首先,我决定使用我的app.component.ts中的代码 this._sailsService.connect(this.url); 它的工作原理,但是当我启动应用程序,我也有这些消息“套接字正试图重新连接到风帆..”我检查,它试图连接到端口4200。 我用sails.io.js "scripts": ["sails.io.js"] 在angular-cli.json中。 但我尝试了其他的东西: <script src="sails.io.js"> // I also tried src="src/sails.io.js </script> <script type="text/javascript"> io.sails.useCORSRouteToGetCookie = false; io.sails.url = 'http://localhost:1337'; </script> 在index.html中,我的浏览器返回它无法加载脚本在“ http:// localhost:4200 / sails.io.js ”或“ http:// localhost:4200 / src / sails.io.js ” 文件夹: app.js angular-cli.json src -index.html -sails.io.js -app –app.component.ts 我不知道为什么它会在angular-cli.json中调用时连接到4200,以及为什么在索引中调用时无法访问我的sails.io.js。

mern项目部署在现场ssl

我想在ssl上部署mern项目。目前它在服务器上运行ip地址。但是当我在ssl上部署它不运行。它在http上工作正常。 我有节点模块传输节点上的变化,并使其HTTP http。 1 – 我使用nginx作为代理服务器 当我部署在SSL上它给错误: – 1-emitter.js?8a6f:50选项https:// privateIp:port / net :: ERR_SSL_PROTOCOL_ERROR 2-websocket.js?0f24:6与'ws:// privateip / sockjs-node / 831 / bocznd0p / websocket'的WebSocket连接失败:WebSocket握手期间出错:意外的响应代码:400 3-你的请求是http,而它需要https。(握手问题)

./ClientApp/boot.server.ts中的错误找不到模块:错误:无法parsing'./../$$_gendir/ClientApp/app/app.server.module.ngfactory'

我使用.Net核心2.0.3与第三方软件包。 我在使用'dotnet publish'命令时遇到下面的错误。 Microsoft(R)Build Engine版本15.4.8.50001,用于.NET核心版权所有(C)Microsoft Corporation。 版权所有。 WebApplication6 – > D:\ incident \ WebApp_95367a2a \ bin \ Debug \ netcoreapp2.0 \ WebApplication6.dll npm WARN可选SKIPPING可选的依赖:fsevents@1.1.3(node_modules \ fsevents):npm WARN不可以跳过可选的依赖:fsevents不支持的平台@ 1.1.3:想要{“os”:“darwin”,“arch”:“any”}(current:{“os”:“win32”,“arch”:“x64”}) join17.679s哈希116包:8dde8c59d57adf41d181f75d6401e1c57572e1e2版本:2.5.1的WebPack儿童哈希:8dde8c59d57adf41d181时间:50549ms资产大小的块组块名称89889688147bd7575d6327160d64e760.svg 109 KB [发出] 4dc129540072fa1a1317a8dbeee744f7.svg 146 KB [发出] c848e0404000287e4fd9d523dd8345e3.svg 264 KB [发射] [大] vendor.js 194 kB 0 [排放]供应商vendor.css 2.69 MB 0 [散发] [大]供应商儿童散列:f75d6401e1c57572e1e2时间:50650ms资产大小块大小名称89889688147bd7575d6327160d64e760.svg 109 kB [emit] 4dc129540072fa1a1317a8dbeee744f7.svg […]

从TypeScript Firebase Admin SDK初始化失败

我正在尝试在我的TypeScript(Nest.js)应用程序中导入Firebase Admin SDK。 let serviceAccount = require("../../creds.json"); console.log(serviceAccount); const firebase = require("firebase"); firebase.initializeApp(environment.firebase); admin.initializeApp({ credential: admin.credential.cert(serviceAccount), databaseURL: "projectid" }); 但是当我尝试构build应用程序时,出现以下错误。 ERROR in ./node_modules/@google-cloud/firestore/src/v1beta1/firestore_client.js Module not found: Error: Can't resolve './firestore_client_config' in '/home/jaybell/trellis-server/trellis/node_modules/@google-cloud/firestore/src/v1beta1' @ ./node_modules/@google-cloud/firestore/src/v1beta1/firestore_client.js 28:17-53 @ ./node_modules/@google-cloud/firestore/src/v1beta1/index.js @ ./node_modules/@google-cloud/firestore/src/index.js @ ./src/server/main.server.ts ERROR in ./node_modules/google-gax/lib/operations_client.js Module not found: Error: Can't resolve './operations_client_config' in '/home/jaybell/trellis-server/trellis/node_modules/google-gax/lib' @ ./node_modules/google-gax/lib/operations_client.js […]

(Angular4 / MEAN)将请求发送到空本体的本地API结果

我试图发布数据到一个项目的API,例如: "data": { "title": "stack", "notes": "asdsad", "time": "19:02", "meridian": "PM", "type": "Education", "_id": "5a2f02d3bba3640337bc92c9", "days": { "Monday": true, "Tuesday": false, "Wednesday": false, "Thursday": false, "Friday": false, "Saturday": false, "Sunday": false } } 但是,使用HttpClient发布数据时 this.http.post("http://localhost:3000/api/items", JSON.stringify(item)) .subscribe( (val) => { console.log("POST call successful value returned in body", val); }, response => { console.log("POST call in […]

从量angular器运行Java程序

比方说,我有一个Java程序来设置和清理端到端testing的数据。 它可以删除所有表中的所有内容,用一些初始数据填充这些内容。 有没有办法从量angular器内执行它? 我对这两种方法都很感兴趣,例如在beforeEach和afterEach ,以及在testing之间使用量angular器。

在量angular器中debugging

我发现自己在一个完全不同的范围内使用browser.debugger() 。 我不能从我的testing访问其他范围variables,只有全局variables。 这是回溯: debug> bt #0 protractor.js:1039:5 #1 webdriver.promise.ControlFlow.runInNewFrame_ promise.js:1598:20 #2 webdriver.promise.ControlFlow.runEventLoop_ promise.js:1463:8 #3 b native v8natives.js:1594:37 我应该只使用browser和select器进行debugging吗?