Tag: node.js

Firebase手电筒 – Bonsai-ElasticSearch API调用来执行search

我刚刚实施了Firebase Flashlight和Bonsai ElasticSearch ,以便能够在我的iOS应用程序中对我的数据执行预先查询。 我已经完成了以下教程: 使用Node.JS的iOS Firebase Flashlight / ElasticSearch Heroku安装程序 我遇到的问题是,最后,在Heroku上运行Node.js应用程序,我不知道如何继续和使用它来执行我的iOS应用程序中的search。 从我的理解,到目前为止,我必须执行一个API调用我的Bonsai-ElasticSearch ,从那里它将使用Flashlight应用程序,以便返回我想要的结果。 问题是我不知道如何做到这一点,你可以说,我是使用Flashlight或Bonsai-ElasticSearch 。 如果您对我如何做到这一点有什么build议,或者至less指出我的方向是正确的,那将是惊人的。 谢谢

“在Foreach node.js中,迭代器不提供'throw'方法

我遇到了nodejs生成器的麻烦,当我启动我的代码时,我得到了以下错误: node:3632) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: The iterator does not provide a 'throw' method. (node:3632) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code. 代码如下,我使用AdoniJs。 User.all和user.typeModule都是数据库关系。 // This is the function that is called […]

错误,当我部署ng build –prod Angular 4.3.2

我已经通过以下方式将angular度从4.0.0升级到4.3.2: npm install @angular/common@latest @angular/compiler@latest @angular/compiler-cli@latest @angular/core@latest @angular/forms@latest @angular/http@latest @angular/platform-browser@latest @angular/platform-browser-dynamic@latest @angular/platform-server@latest @angular/router@latest @angular/animations@latest typescript@latest rxjs@latest –save 然后我把ng serve和运作良好,但是当我想通过ng build –prod我有以下错误: [1m[33mWARNING in ./src/$$_gendir/app/app.module.ngfactory.ts 730:2-27 "export 'ɵNgModuleInjector' (imported as 'import0') was not found in '@angular/core'[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (11,49): Property 'ɵNgModuleInjector' does not exist on type 'typeof "C:/Data/angular4/system/node_modules/@angular/core/core"'.[39m[22m [1m[31mERROR in C:/Data/angular4/system/src/$$_gendir/node_modules/@angular/core/core.ngfactory.ts (41,79): Property 'parent' does […]

无法通过护照和bcryptlogin时对用户进行身份validation

所以我正在尝试为我的网站创build一个注册/login逻辑,使用passport和bcrypt-nodejs进行密码散列。 我成功地注册了一个用户,但是在login时,我总是进入'false'分支进行密码validation,并且正在获取我的控制台消息'错误的密码'这里是我的login护照代码: passport.use('user-local-login', new LocalStrategy({ // by default, local strategy uses username and password, we will override with email usernameField : 'email', passwordField : 'password', passReqToCallback : true }, function(req, email, password, done) { // callback with email and password from our form // find a user whose email is the same as the forms […]

npm不会安装链接模块的依赖关系

我在moduleA中使用moduleB作为链接依赖。 moduleB依赖于moduleC。 模块B的package.json是这样的: { "name": "moduleB", "bin": { "moduleB-bin": "index.js" }, "dependencies": { "moduleC": "^1.0.0", } } 模块A的package.json是这样的: { "name": "moduleA", "scripts": { "run-moduleB": "moduleB-bin" }, "dependencies": { "moduleB": "file:../moduleB", } } 如果我然后从moduleA的目录运行npm install moduleB ,我最终得到一个如下的目录结构: ├── moduleA │ └── node_modules │ └── moduleB -> ../moduleB └── moduleB └── node_modules └── moduleC moduleC未安装在moduleA/node_modules 。 这与moduleB不是链接的依赖关系会发生什么不同。 […]

离子启动错误证书链中的自签名证书

有人可以帮我解决这个问题。 当我运行CMD中的这个命令(作为pipe理员) ionic start projectName blank 我遇到这个问题 C:\ionic start firstApp blank √ Creating directory .\firstApp – done! [INFO] Fetching app base (https://github.com/ionic-team/ionic2-app- base/archive/master.tar.gz) × Downloading – failed! Error: self signed certificate in certificate chain 我的离子信息: cli软件包: @ ionic / cli-utils:1.6.0 离子(离子CLI):3.6.0 系统: 节点:v8.2.1 操作系统:Windows 10 npm:5.3.0 其他信息: 这是我第一次使用离子

我怎样才能让数字只在Swal Sweetalert

我想知道如何才能让这个部分只有数字。 { title: "Dollar Amount?", text: "How much is your Dollar Question worth?", inputPlaceholder: "Enter Amount" } 我正在使用一个Sweetalert插件。 这几天一直在困扰着我,而我只是新的前端,我真的是一个完整的后端人。 function showDollarQuestion() { if (inUserId === "" || inUserId === null) { socket.emit('stud notif', myuserid,myuserid,"noroom"); }else{ swal.setDefaults({ input: 'text', confirmButtonText: 'Next →', showCancelButton: true, animation: false, progressSteps: ['1', '2'] }) var steps = [ { title: […]

在Nodejs中从Base64string生成X.509证书

假设我有一个Base64证书string和。 我知道如何在C#代码中生成一个x509证书, string base64CertificateString = "MIIxxxxxxxx….xxxx"; string password = "xxxxxxxx"; byte[] bytes = Convert.FromBase64String(base64CertificateString); X509Certificate2 x509certificate = new X509Certificate2(bytes, password, X509KeyStorageFlags.DefaultKeySet); 我怎样才能在Nodejs做同样的事情?

HTML分页问题

我正在将HTML转换为PDF格式,并且工作正常,但是我有一个数据如何显示的问题。 我有一个string数组,我正在循环它们,并在我的ejs模板中显示它们。例如: <div style="page-break-after: auto; padding: 10px;"> <h3>Cost Saving Calculation:</h3> <p><%= modules[i].costSavedInfo %></p> </div> <div style="page-break-after: auto; padding: 10px;"> <h3>Culture Change</h3> <p><%= modules[i].cultureChange %></p> </div> <div style="page-break-after: auto; padding: 10px;"> <h3>Other Efficiency</h3> <p><%= modules[i].otherEfficieny %></p> </div> 问题: 当生成PDF时,文本显示在2页中,如下所示: 在上面的图像中,一半的文本在一个pdf页面上,另一个在第二页面上。 我不确定是否有可能,但是如何更改将文本移动到新页面的HTML,如果它将显示在2页中。 现在数组中文本的长度可以是任何东西。没有任何字数限制。 这甚至有可能吗?

用户在文本段落内部标记程序逻辑

您好,我有一个基本的社交networking应用程序的要求。 我的问题似乎很愚蠢,这只是为了从你们那里得到观点和程序逻辑。 我的要求是,用户必须能够提供其他用户在testing职位内的名称完全相同的Facebook。 看到下面的图片 我想显示在facebook中相同的职位 有人可以build议我一个很酷的想法做到这一点。 我的计划是以下。 创build一个类似于这个“@ user-userid这是一个testing”的post文本,并在post详细信息中包括用户详细信息。用post详细信息中的名称replace“@ user-userid”。 有没有更好的想法做同样的? 提前致谢…. PS:我需要在Android,IOS和angularJs Web应用程序上执行相同的逻辑。