我有一个简短的问题。我不知道为什么这段代码不起作用,我尝试了不同的选项来获取我的localhost。
每次我试图加载我的localhost时都会得到这个:
拒绝加载字体“数据:应用程序/字体WOFF;字符集= UTF-8; BASE64,d09GRgABAAAAAJs0ABMAAAABTVgAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABGRlRNAAABqAAAABwAAAAcaikRNkdERUYAAAHEAAAALQAAADIDDwH7R1BPUwAAAfQAABgwAABX1Oqq9j9HU1VCAAAaJAAAAXQAAALKqyaj7U9TLzIAABuYAAAAVgAAAGCRWm0zY21hcAAAG / AAAAGQAAAB6jHNvzdjdnQgAAAdgAAAAEYAAABGFNMQDmZwZ20AAB3IAAABsQAAAmVTtC + nZ2FzcAAAH3wAAAAIAAAACAAAABBnbHlmAAAfhAAAcrwAAN3gTmoUWWhlYWQAAJJAAAAAMQAAADYJ67FUaGhlYQAAknQAAAAeAAAAJA0SBixobXR4AACSlAAAAkgAAAOuDPhKF2xvY2EAAJTcAAABzAAAAdq5toTebWF4cAAAlqgAAAAgAAAAIAIJAfRuYW1 ... FGDtLEEpoJ0EKQpSxjOZ9YwUpaWcUaVnOFQ6xjLevZENrBN65yhrNc4w1vJUESJUmSJUVSJU3SJUMyJUuyJUdyOcd5LnGZ21zgInfYzAnJ4wY3JV8K2CGFUiTFUiKlZm9Da7NPswQb / TabrUrpUlZEdNuU6tyjK + 1KpzJ8Xw81KjWlrrQrHUqnskxZrnQp / 81zR9TUXE2z1vu9wUBdbU2LL1LSjYhOw1QdDDSFE6dR + VfDE3lHSF1pVzr + AG3To18AAHjaRc09DoJAFARgVmD5kX9WrYyYaOPewBpoaIwVm3gOaxtjpY0XeVgZL6cTs67d + 2aSeU / 2PhO7Wh35u35g7KaGlst + SZnqSOxxnNScuDz0FtlVQ7asyamah12M5Bcu4Ew1OODWGh7A1xo + 4K00AsCfaYRV87IClljaY5ShXmcU6Z8x0sgbycFuj2ACxn + mYHIxzMB UGuZgtjEswHxhWIKFMBRgeTecgGL7oyIhPxkEU + kAAAABVlMCyQAA'因为它违反了以下内容安全策略指令:“default-src'self'”。请注意,'font-src'未明确设置,因此'default-src'用作后备。
session.html无法加载资源:服务器响应了一个 状态404(未找到)
这是我的代码:
import express = require ("express");
import { Request, Response } from "express";
import session = require('express-session');
let router = express();
router.listen(8080, "localhost", function () {
console.log(" Aufruf: http://localhost:8080/../../session.html");
});
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Sessions</title>
<link rel="stylesheet" href="http://www.w3schools.com/lib/w3.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/style.css">
<script language="javascript" type="text/javascript" src="/sessions/sessionServer.js"></script>
<script language="javascript" type="text/javascript" src="/sessions/session.js"></script>
<script language="javascript" type="text/javascript" src="/jquery/dist/jquery.js"></script>
</head>
结构是:
文件夹会话:
不同的文件夹
3.1文件夹
3.2 ..
3.3 session.html