-
Notifications
You must be signed in to change notification settings - Fork 271
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Serve Vue app in internal_dashboard.blade.php from public/build folder
- Loading branch information
Showing
13 changed files
with
159 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
namespace App\Client\Http\Controllers; | ||
|
||
use App\Http\Controllers\Controller; | ||
use Illuminate\Http\Request; | ||
use Ratchet\ConnectionInterface; | ||
use GuzzleHttp\Psr7\Message; | ||
use GuzzleHttp\Psr7\Response; | ||
|
||
class FileController extends Controller | ||
{ | ||
public function handle(Request $request, ConnectionInterface $httpConnection) | ||
{ | ||
$file = $request->get("path"); | ||
|
||
$filePath = app()->basePath() . "/public/" . $file; | ||
|
||
if(!file_exists($filePath)) { | ||
$httpConnection->send(Message::toString(new Response( | ||
404, | ||
['Content-Type' => 'text/html'], | ||
"File not found" | ||
))); | ||
return; | ||
} | ||
|
||
$file = file_get_contents($filePath); | ||
$contentType = mime_content_type($filePath); | ||
|
||
if(str($filePath)->endsWith(".css")) { | ||
$contentType = "text/css"; | ||
} | ||
|
||
$httpConnection->send(Message::toString(new Response( | ||
200, | ||
['Content-Type' => $contentType], | ||
$file | ||
))); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
1 change: 1 addition & 0 deletions
1
public/build/internal-dashboard/build/assets/index-CusWAS5C.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
17 changes: 17 additions & 0 deletions
17
public/build/internal-dashboard/build/assets/index-mleR6s9-.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Vite + Vue + TS</title> | ||
<script type="module" crossorigin src="/assets/index-mleR6s9-.js"></script> | ||
<link rel="stylesheet" crossorigin href="/assets/index-CusWAS5C.css"> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Expose Dashboard</title> | ||
<script type="module" crossorigin src="/assets/index-CZHspyA5.js"></script> | ||
<link rel="stylesheet" crossorigin href="/assets/index-8zj_ClGA.css"> | ||
</head> | ||
<body> | ||
<div id="app"></div> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>Dashboard</title> | ||
<link rel="stylesheet" href="{{ asset('build/assets/[your-css-file].css') }}"> | ||
<title>Internal Dashboard</title> | ||
|
||
<link href="{{ $cssFile }}" rel="stylesheet"> | ||
</head> | ||
|
||
<body> | ||
<div id="vue-dashboard"></div> | ||
<div id="internalDashboard"> | ||
</div> | ||
|
||
<script src="{{ asset('build/assets/[your-js-file].js') }}"></script> | ||
<script src="{{ $jsFile }}"></script> | ||
</body> | ||
|
||
</html> |