小编Tia*_*eis的帖子

Durandal/Require.JS - 未找到信号器/集线器参考

我正在使用"HotTowel"单页应用模板,但我无法使SignalR正常工作.我收到以下错误:

Failed to load resource: the server responded with a status of 404 (Not Found)
http://localhost:8184/signalr/hubs
Run Code Online (Sandbox Code Playgroud)

我有一种使用标准MVC 4单页面应用程序的样板,有一个非常简单的集线器(用户在线计数器).一切都很好.

切换到"HotTowel"后,它停止工作.我和John Papa一起检查过,他给了我一个建议来检查Durandal方面,因为他提到他知道在一些干扰某些路由的问题上要做一些修复.

main.js:

require.config({
  paths: {
    "text": "durandal/amd/text",
    "signr": "../scripts/jquery.signalR-1.0.1.min"
  }
});
define(['durandal/app', 'durandal/viewLocator', 'durandal/system', 'durandal/plugins/router', 'services/logger', "signr"],
  function (app, viewLocator, system, router, logger, sigr) {

  // Enable debug message to show in the console
  system.debug(true);

  app.start().then(function () {
    toastr.options.positionClass = 'toast-bottom-right';
    toastr.options.backgroundpositionClass = 'toast-bottom-right';

    router.handleInvalidRoute = function (route, params) {
      logger.logError('No Route Found', route, 'main', true);
    };

    // When finding a …
Run Code Online (Sandbox Code Playgroud)

singlepage requirejs signalr durandal

4
推荐指数
1
解决办法
2838
查看次数

标签 统计

durandal ×1

requirejs ×1

signalr ×1

singlepage ×1