laravel - 一种在本地环境中使用asset(mix(file.js)) 的方法
问题描述
从这里切换我的资产加载后:
<!-- Scripts -->
<script src="js/index.js" defer></script>
<!-- Styles -->
<link href="css/app.css" rel="stylesheet">
<link href="css/fonts.css" rel="stylesheet">
<link href="css/container.css" rel="stylesheet">
对此:
<!-- Scripts -->
<script src="{{ asset(mix('/js/index.js'), true) }}" defer></script>
<!-- Styles -->
<link href="{{ asset(mix('/css/app.css'), true) }}" rel="stylesheet">
<link href="{{ asset(mix('/css/fonts.css'), true) }}" rel="stylesheet">
<link href="{{ asset(mix('/css/container.css'), true) }}" rel="stylesheet">
然后当试图访问 http://localhost 它只是抛出Failed to load resource: net::ERR_CONNECTION_REFUSED
. 我知道这是我的本地站点一直在使用 HTTP 而不是 HTTPS。但是有没有任何便宜的解决方案可以在不为 localhost 设置 HTTPS 的情况下完成这项工作?
解决方案
推荐阅读
- c# - 由于某些奇怪的原因,托管 C# 应用程序将字符串作为空字节 [] 传递... IronPDF
- python-3.x - 通过美汤python从html div类中提取文本元素
- arrays - 如何使用 reactjs 和 graphql 在 gatsby 中映射嵌套数组
- reactjs - 无法弄清楚为什么我的代码不会呈现
- r - 我们如何找到与列的特定数据点最近的行?
- android - 我是第一次来,不能使用 Admob 实现,有些错误
- c - g++ Mac Curl 架构 x86_64 的未定义符号
- php - 在laravel 6中返回带有状态码和数据的json响应
- r - R包knitr无法打开png()设备
- node.js - 我以前工作的 node/express/mongoose 服务器运行良好,现在它发出一个奇怪的错误