这个问题是因为需要确保我对代码所做的更改不会影响它输出到文本文件的值。理想情况下,我会根据内容是否相同、空格和所有内容,滚动sub来接收两个文件名和return 1或return 0。
鉴于文本处理是Perl的强项,比较两个文件并确定它们是否相同应该很容易(下面的代码未经测试)。
use strict;
use warnings;
sub files_match {
my ( $fileA, $fileB ) = @_;
open my $file1, '<', $fileA;
open my $file2, '<', $
我有两个应用程序,一个nodejs和另一个react。我的用户没有登录,我返回节点应用程序,如果用户登录,我想返回的反应应用index.html文件。
location / {
if ($cookie_isLoggedIn = "true") {
// how can I return the index.html file here ?
}
proxy_pass http://localhost:3000;
}
到目前为止我尝试过的是:
rewrite ^/$ /platform-build/index.html; -不做anythin