未找到Sails.js资产

时间:2017-03-21 14:40:14

标签: javascript html css gruntjs sails.js

我正在创建一个sails.js应用。我遇到的问题似乎是资产文件夹中包含的每个文件都无法正常工作。例如,我在assets文件夹中创建了一个testing123.js文件,该文件只向控制台发送一条简单的消息。但是永远不会记录该消息。我有另一个文件应该为Jquery验证设置规则。但是我的登录表单上的验证不起作用。 CSS样式似乎也不起作用。当我在Chrome中检查并导航到Sources选项卡时,我查看这些文件只是为了仔细检查发生了什么。令我惊讶的是,我发现Asset文件夹中的每个文件显然都具有相同的内容。这些内容如下:

<!DOCTYPE html>
<html>
<head>
<title>Login</title>
<!-- Viewport mobile tag for sensible mobile support -->
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!--
    Stylesheets and Preprocessors
    ==============================

    You can always bring in CSS files manually with `<link>` tags, or asynchronously
    using a solution like AMD (RequireJS).  Or, if you like, you can take advantage
    of Sails' conventional asset pipeline (boilerplate Gruntfile).

    By default, stylesheets from your `assets/styles` folder are included
    here automatically (between STYLES and STYLES END). Both CSS (.css) and LESS (.less)
    are supported. In production, your styles will be minified and concatenated into
    a single file.

    To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
    For example, here are a few things you could do:

        + Change the order of your CSS files
        + Import stylesheets from other directories
        + Use a different or additional preprocessor, like SASS, SCSS or Stylus
-->
<!--Import Google Icon Font-->
<link href="http://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!-- Compiled and minified CSS: Materialize -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/css/materialize.min.css">

<!--STYLES-->
<link rel="stylesheet" href="/styles/importer.css">
<link rel="stylesheet" href="/styles/style.css">
<!--STYLES END-->
<!--
    Client-side Javascript
    ========================

    You can always bring in JS files manually with `script` tags, or asynchronously
    on the client using a solution like AMD (RequireJS).  Or, if you like, you can
    take advantage of Sails' conventional asset pipeline (boilerplate Gruntfile).

    By default, files in your `assets/js` folder are included here
    automatically (between SCRIPTS and SCRIPTS END).  Both JavaScript (.js) and
    CoffeeScript (.coffee) are supported. In production, your scripts will be minified
    and concatenated into a single file.

    To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
    For example, here are a few things you could do:

        + Change the order of your scripts
        + Import scripts from other directories
        + Use a different preprocessor, like TypeScript

-->
<!--Import jQuery before materialize.js-->
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<!-- Compiled and minified JavaScript: Materialize -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.8/js/materialize.min.js"></script>
<!-- Compiled and minified JavaScript: JQuery Form Validation -->
<script src="https://cdn.jsdelivr.net/jquery.validation/1.16.0/jquery.validate.min.js"></script>
<!--SCRIPTS-->
<script src="/js/dependencies/sails.io.js"></script>
<script src="/js/script.js"></script>
<!--SCRIPTS END-->
</head>
<body>
<div class="section"></div>
<main>
    <center>
        <div class="section"></div>
        <h5 class="indigo-text">Please, login into your account</h5>
        <div class="section"></div>
        <div class="container">
            <div class="z-depth-1 grey lighten-4 row" style="display: inline-block; padding: 32px 48px 0px 48px; border: 1px solid #EEE;">

                <form id="loginForm" class="col s12" method="POST" action="/CMD_User/login">
                    <div class='row'>
                        <div class='col s12'>
                        </div>
                    </div>

                    <div class='row'>
                        <div class='input-field col s12'>
                            <input class='validate' type='email' name='email' id='email'/>
                            <label for='email'>Enter your email</label>
                            <div class="errorTxt1"></div>
                        </div>
                    </div>

                    <div class='row'>
                        <div class='input-field col s12'>
                            <input class='validate' type='password' name='password' id='password'/>
                            <label for='password'>Enter your password</label>
                            <div class="errorTxt2"></div>
                        </div>
                        <label style='float: right;'>
                            <a class='pink-text' href='#!'><b>Forgot Password?</b></a>
                        </label>
                    </div>

                    <br />
                    <center>
                        <div class='row'>
                            <button type='submit' name='btn_login' class='col s12 btn btn-large waves-effect indigo'>Login</button>
                        </div>
                    </center>
                </form>
            </div>
        </div>
    </center>
</main>
<script src="/testing123.js"></script>
<!--
    Client-side Templates
    ========================

    HTML templates are important prerequisites of modern, rich client applications.
    To work their magic, frameworks like Backbone, Angular, Ember, and Knockout require
    that you load these templates client-side.

    By default, your Gruntfile is configured to automatically load and precompile
    client-side JST templates in your `assets/templates` folder, then
    include them here automatically (between TEMPLATES and TEMPLATES END).

    To customize this behavior to fit your needs, just edit `tasks/pipeline.js`.
    For example, here are a few things you could do:

        + Import templates from other directories
        + Use a different template engine (handlebars, jade, dust, etc.)
        + Internationalize your client-side templates using a server-side
            stringfile before they're served.
-->
<!--TEMPLATES-->
<!--TEMPLATES END-->
</body>

关于什么可能使我的所有资产文件(js,css)具有相同内容的任何想法。具体为什么这个html文件?谢谢!

如果您需要更多信息,请与我们联系。

0 个答案:

没有答案