vendredi 28 juillet 2017

Laravel - /js/app.js not found 404 error

I installed Laravel 5.4 in my server /public_html/laravel/ folder. When I access http://ift.tt/2h8aOhh, it works.

I copied all my compiled files in my local public/ folder into the http://ift.tt/2h8aOhh. Then I add the <script src="/js/app.js"></script> into my welcome.blade.php:

<!doctype html>
<html lang="">
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <meta name="csrf-token" content="">
        <title>Laravel</title>
        <!-- UIkit CSS -->
        <link rel="stylesheet" href="http://ift.tt/2eSqwfK" />
        <!-- <link rel="stylesheet" href="assets/sass/uikit.css" /> -->

        <!-- jQuery is required -->
        <script src="http://ift.tt/2n9t8Vj"></script>

        <!-- UIkit JS -->
        <script src="http://ift.tt/2eTBIZQ"></script>
        <script src="http://ift.tt/2h8fWlL"></script>
        <!-- Fonts -->
        <link href="http://ift.tt/2dHeAcp" rel="stylesheet" type="text/css">

    </head>
    <body>
        <div id="app" style="background:#666;height: 100vh;">

            <router-view></router-view>
        </div>

         <script src="/js/app.js"></script>
    </body>
</html>

But when I go to http://ift.tt/2h8aOhh again, I got 404 error:

GET http://ift.tt/2h8aOOj 404 (Not Found)

if I change to <script src="/laravel/public/js/app.js"></script>, I will get another 404 error:

GET http://ift.tt/2eTBgL8 404 (Not Found)

How can I resolve this?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire