【发布时间】:2018-01-31 08:14:59
【问题描述】:
我在 heroku 上托管了一个小型网络应用程序。我的问题是当我尝试从 angularjs 执行 php 文件时,控制台日志说我找不到它。在我的本地主机上完美运行! 这是代码。
从控制器(app.js):
$http({
method: 'POST',
url: 'generarPDF.php',
data: misProductos,
}).
then(function(response){
alert(response.data);
})
我的 php 只是接收数据并通过邮件发送。控制器文件和 php 文件在同一目录中。 节点服务器:
var app = express();
app.use(express.static(path.join(__dirname)));
app.get('/', function(req, res){
res.sendFile(path.join(__dirname + '/admin_3/index.html'));
});
app.get('/page_general_portfolio_3.html', function(req, res){
res.sendFile(path.join(__dirname + '/admin_3/page_general_portfolio_3.html'));
});
app.get('/page_general_about.html', function(req, res){
res.sendFile(path.join(__dirname + '/admin_3/page_general_about.html'));
});
app.get('/form_controls_md.html', function(req, res){
res.sendFile(path.join(__dirname + '/admin_3/form_controls_md.html'));
});
app.get('/ecommerce_products_edit.html', function(req, res){
res.sendFile(path.join(__dirname + '/admin_3/ecommerce_products_edit.html'));
});
这是heroku日志:
2018-01-31T00:00:41.789571+00:00 heroku[web.1]:停止所有进程 使用 SIGTERM 2018-01-31T00:00:41.867855+00:00 heroku[web.1]:进程 退出状态为 143 2018-01-31T00:00:51.631278+00:00 heroku[web.1]: 使用命令
npm start启动进程
提前致谢!
【问题讨论】:
-
the console log says me that can't found itapi can' found or file can't found?
标签: php angularjs node.js heroku