【问题标题】:Failed to run Sencha CMD generated ExtJS 6.2 app on Node js无法在 Node js 上运行 Sencha CMD 生成的 ExtJS 6.2 应用程序
【发布时间】:2020-08-17 22:02:43
【问题描述】:

我正在尝试在 Node.js 上运行使用 Sencha CMD 生成的现有 ExtJS 6.2 应用程序。下面是我的 app.js:

const express = require('express');
const app  = express();

//Middleware
app.use(express.static(__dirname + '/public/monitor/' ));
app.post('/', function( req ,res){
    res.send("Success");
});

app.listen(3000, function(){
    console.log('Server running on port 3000');
});

var server = app.listen(3300, function () {
    var host = server.address().address;
    var port = server.address().port;

    console.log('App listening at http://%s:%s', host, port);
});

但是,由于以下错误,无法运行页面。

Refused to apply style from 'http://localhost:3000/build/development/Monitor/classic/resources/Monitor-all_1.css?_dc=1597650810261' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

sencha website 中已有指南,但不适用于 GPL 版本的 ExtJS。所以我无法更新到 ExtJS 6.6 或 7.0。

有什么解决办法吗?

【问题讨论】:

  • 在浏览器中直接加载url的时候?你得到什么回应?一个 html 或一个 css ??如果它是一个 html,你需要修复它
  • 一个没有css的html页面加载。我该如何解决?
  • 基本上,您的静态文件是从“public/monitor”文件夹呈现的。所以你的路径build/development/Monitor/classic/resources/Monitor-all_1.css 应该出现在这个文件夹中。如果不是,您必须更正路径。

标签: node.js express extjs sencha-cmd


【解决方案1】:

该问题是由于文件夹中缺少 css 文件引起的。我从另一台机器上得到它,它解决了这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-07-18
    • 1970-01-01
    相关资源
    最近更新 更多