Tag: laravel

如何访问节点js中的laravel envvariables?

我想在我的socket.io服务器安装中访问laravel的APP_KEY envvariables,但不知道如何访问任何laravel环境variables。 任何帮助表示赞赏。

我如何从localhost(laravel,nodejs)调用localhost?

我正在写节点和laravel的应用程序。 我正在运行小的laravel本地服务器,它parsing为http:// localhost:8000 。 我也在localhost:3000上运行节点服务器。 然后尝试从第二个调用第一个服务器。 这里是NodeJs代码: var restify = require('restify'); var server = restify.createServer(); server.listen(3000, function() { console.log('%s listening at %s', server.name, server.url); }); 这里是我发出http请求的地方: var http = require('http'); module.exports = { call: function (host, path) { var options = { host: host, path: path, port: 8000, method: 'GET' }; callback = function(response) { […]

只使用redis socketio来与Php进行通信,反之亦然

只使用redis socketio来与Php进行通信,反之亦然 对于laravel中的这类事件来说,我相当陌生,但是我不太清楚如何使用Laravel在socketio和php之间进行通信。 我相当新的这个框架,请容易在我身上。 我已经知道如何从PHP到Nodejs socketio进行通信,但问题是我不知道相反的通信是如何工作的! 一世 注意:我的PHP会话是REDIS 这是我的命令 class ChatCommand extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'command:name'; /** * The console command description. * * @var string */ protected $description = 'Command description'; /** * Create a new command […]

Laravel nodejs socket io

对于我的生活,我不能让我的页面连接到客户端节点js服务器服务套接字io! 当服务页面是public_html文件中的静态页面时,所有的工作都很好,但是一旦我使用laravel的视图,客户端就会回到长时间的轮询,而这个轮询并不是真正的。 我甚至无法得到它在控制台上输出连接味精。 服务器: var socket = require( './public/node_modules/socket.io' ); var express = require('./public/node_modules/express'); var app = express(); var server = require('http').createServer(app); var io = socket.listen( server ); var port = process.env.PORT || 3000; server.listen(port, function () { console.log('Server listening at port %d', port); }); io.on('connection', function (socket) { console.log('user connected'); }); 客户 <script src="{{ […]

我可以从Laravel运行Elixir(Laravel)任务运行器任务吗?

我一直在看Laravel文档https://laravel.com/docs/5.2/elixir的 Laravel Elixir。 我知道你通过package.json来安装它,这是npm所使用的文件,它不是Laravel的包pipe理(composer.json)的一部分,然后你可以用一些命令来为前端脚本的构buildpipe理CSS。 如果我想将Elixir作为Laravel堆栈的一部分,例如图像,我需要做什么?

错误:找不到模块“is-utf8”

你好,我在我的项目中使用elixar包来编译所有的scss文件。 我运行命令npm install来安装所有必需的依赖项。 我跑了gulp指挥,但它扔了我这个错误。 错误:找不到模块“is-utf8'`。 我已经删除了node_modules文件夹,并再次运行npm install命令,然后尝试运行gulp但仍然抛出此错误。 我的节点版本是6.4.0 ,npm版本是3.10.6 。 请告诉我为什么我面临这个错误。 我花了整整一天,但我不明白为什么我面临这个错误

stream明(Laravel)VS NODE.JS解决scheme

我需要开发一个API后端,它应该是: 强大的 高性能 提供RESTFULL API 连接到一个Mysql存储:我更喜欢关系数据库的复杂性 只有后端也不是前端框架 我不确定: stream明:我只需要API服务,因为我select反应js作为前端框架..所以我认为是更好的stream明比laravel,因为我不需要前端 Nodejs api解决scheme:在这个时候,在网上search我发现密封和回环作为我的api后端的框架。 我发现discortanti的意见…有人告诉说,作为stream明的PHP解决scheme是不好的performance(见http://www.infoworld.com/article/2866712/php/php-vs-node-js-an-epic-battle -for-developer-mind-share.html )….有人告诉我,在这个时候,节点js中没有可靠的api后端框架:海豹对于性能并不好,关于环回,我发现几个评论…所以我问你什么是最好的select性能和强大的解决scheme..

我无法在ubuntu16.04上运行nodejs

我在我的ubuntu16.04上安装了nodejs。 但是我不能运行这个。 当我写一个命令npm运行dev它显示以下错误: > @ dev /var/www/html/laravel > node node_modules/cross-env/bin/cross-env.js NODE_ENV=development node_modules/webpack/bin/webpack.js –progress –hide-modules –config=node_modules/laravel-mix/setup/webpack.config.js module.js:472 throw err; ^ Error: Cannot find module '/var/www/html/laravel/node_modules/cross-env/bin/cross-env.js' at Function.Module._resolveFilename (module.js:470:15) at Function.Module._load (module.js:418:25) at Module.runMain (module.js:605:10) at run (bootstrap_node.js:425:7) at startup (bootstrap_node.js:146:9) at bootstrap_node.js:540:3 npm ERR! Linux 4.4.0-66-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "run" "dev" npm ERR! node […]

错误在Windows上安装laravel-elixir:npm ERR! EEXIST,打开'\ AppData \ Roaming \ npm-cache \ 837c67b9-adable-s tream-1-0-33-package-tgz.lock'

我有一个新的安装laravel 5.1 。 我遵循这些步骤来设置药剂,Bootstrap,字体真棒等。当我运行npm install它会引发错误。 我也尝试使用npm install –no-bin-links作为laravel elixir文档build议。 $ npm install –no-bin-links npm WARN optional dep failed, continuing fsevents@0.3.8 npm WARN optional dep failed, continuing fsevents@0.3.8 > node-sass@3.2.0 install c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass > node scripts/install.js Binary downloaded and installed at c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node > node-sass@3.2.0 postinstall c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass > node scripts/build.js ` c:\Users\user\PhpstormProjects\my_project\node_modules\laravel-elixir\node_modules\gulp-sass\node_modules\node-sass\vendor\win32-x64-11\binding.node ` exists. testing binary. Binary is […]

PHP和node.js在同一台机器上进行通信的最快方式是什么?

我有一个Laravel应用程序正在使用node.js (express)服务器到服务器端渲染React页面。 这两个进程在同一台机器上。 目前Laravel使用一些初始数据(以JSON)向本地节点服务器发送POST请求,并从中接收呈现的HTMLstring。 POST请求目前需要100ms到200ms,而渲染本身如果平均执行20ms。 什么是其他80 / 180ms被花费? 我曾尝试使用RPC的DNode,但延迟是可比的。