Laravel5.6 dynamically generates js files and returns 404.

problem description

because I"m going to do SPA web. So you need a dynamic configuration file
, for example, I want to: xxx.com/setter.js

Environment
Server: ngnix
php:7.2.6
laravel:5.6

related codes

routing settings

(function(root,factroy){
    typeof root.xxxx === "object" ? xxxx.setter = factroy() :
    root.setter = factroy();
}(this,function(){
    return {
        name:"xxx",
        csrf:"{{ csrf_token() }}"
    };
}));

actual situation

what is returned in the src of script is 404, and there is no content.
returns 404 in the href of link:css, with no content.
returns 404 in the src of img, with content.
address bar access returns 404, with content.

I"m really drunk.

Mar.28,2021

if you just want to complete the csrf_token, you can put the generated token on a global variable or on an element. When you want to use it, you can just take it


it seems to be the only way for now.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e61987-45958.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e61987-45958.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?