Wie erhalte ich die angle.js-Dateien unter IIS 7.5 für den bereitgestellten winkligen Full-Stack?
--AKTUALISIERE
Jetzt bekomme ich diesen Fehler, aber das Neuschreiben sieht so aus, als würde es funktionieren, aber es liest JS-Dateien wie HTML oder ein ähnliches Problem.
Ich möchte die richtigen Regeln zum erneuten Schreiben für web.config unter IIS 7.5 für die Bereitstellung von winkligen Full-Stack-Anwendungen erstellen.
Dies ist meine WEB.CONFIG, die ich benutzediese aber ich kann den virtuellen Pfad nicht konfigurieren
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<system.webServer>
<handlers>
<add name="iisnode" path="server.js" verb="*" modules="iisnode"/>
</handlers>
<iisnode node_env="PRODUCTION"
nodeProcessCountPerApplication="1"
maxConcurrentRequestsPerProcess="1024"
maxNamedPipeConnectionRetry="100"
namedPipeConnectionRetryDelay="250"
maxNamedPipeConnectionPoolSize="512"
maxNamedPipePooledConnectionAge="30000"
asyncCompletionThreadCount="0"
initialRequestBufferSize="4096"
maxRequestBufferSize="65536"
uncFileChangesPollingInterval="5000"
gracefulShutdownTimeout="60000"
loggingEnabled="true"
logDirectory="iisnode"
debuggingEnabled="true"
debugHeaderEnabled="false"
debuggerPortRange="5058-6058"
debuggerPathSegment="debug"
maxLogFileSizeInKB="128"
maxTotalLogFileSizeInKB="1024"
maxLogFiles="20"
devErrorsEnabled="true"
flushResponse="false"
enableXFF="false"
promoteServerVars=""
configOverrides="iisnode.yml"
watchedFiles="web.config;*.js" />
<rewrite>
<rules>
<!-- Don't interfere with requests for node-inspector debugging -->
<rule name="NodeInspector" patternSyntax="ECMAScript" stopProcessing="true">
<match url="^server.js\/debug[\/]?"/>
</rule>
<!-- serve static files from /public folder -->
<rule name="StaticContent">
<action type="Rewrite" url="public/{R:0}" logRewrittenUrl="true"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true"/>
</conditions>
<match url="public/*"/>
</rule>
<!-- All other URLs are mapped to the Node.js application entry point -->
<rule name="DynamicContent">
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="True"/>
</conditions>
<action type="Rewrite" url="server.js"/>
</rule>
<rule name="SocketIO" patternSyntax="ECMAScript">
<match url="socket.io.+"/>
<action type="Rewrite" url="server.js"/>
</rule>
</rules>
</rewrite>
<!-- <appSettings>
<add key="virtualDirPath" value="/idetikmssql"/>
</appSettings> -->
</system.webServer>
DAS IST MEIN server.js
"use strict";
var express = require('express'),
stylus = require('stylus'),
logger = require('morgan'),
bodyParser = require('body-parser');
// determind what mode we are
var env = process.env.NODE_ENV = process.env.NODE_ENV||'developemnt';
var virtualDirPath = process.env.virtualDirPath || '';
var app = express();
//configure the view engine
function compile(str, path) {
return stylus(str).set('filename', path);
}
app.set('views', __dirname + '/server/views/');
app.engine('html', require('ejs').renderFile);
app.set('view engine', 'html');
app.use(stylus.middleware(
{
src: __dirname + 'public',
compile: compile
}
));
app.use(bodyParser());
var appPath = app.get('appPath')
app.use('/bower_components', express.static(appPath + "/bower_components/"));
app.use('/app/', express.static(appPath + "/app/"));
app.use('/assets', express.static(appPath + "/assets/"));
app.use(express.static(__dirname + '/public'));
app.get('/partials/:partialsPath', function (req, res) {
debugger;
res.render('partials/' + req.params.partialsPath);
});
//the asterisk handles all routes includes javascript, css, html request...
app.get('*', function (req , res) {
res.render('index');
});
// app.get(virtualDirPath + '/', function(req, res) {
// res.render('index', { virtualDirPath: virtualDirPath });
// })
var PORT = 3030;
app.listen((process.env.PORT!==undefined)?process.env.PORT:PORT);
console.log('Listening to PORT : ' + process.env.PORT );
console.log(__dirname);
DAS IST MEIN INDEX.HTML
<!doctype html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
<!-- <base href="/"> -->
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
</head>
<body ng-app="idetikApp">
<div ng-view=""></div>
</body>
<script type="text/javascript" src="app/app.js"></script>
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="bower_components/angular-route/angular-route.js"></script>
<script type="text/javascript" src="bower_components/angular-resource/angular-resource.js"></script>
</html>
Ich füge meine Dateistruktur in IIS hinzu
- EINER MEINER LÖSUNGEN
Ich habe versucht, eine Express-Anwendung von Grund auf zu installieren, und sie funktioniert. Ich muss nur die Portnummer für process.env.PORT und die Ausführung ändern, aber der Full-Stack kann sie immer noch nicht zum Laufen bringen. @ Ich brauche immer noch Hilf
HERE MEINE APP FUNKTIONIERT FEIN AUF IIS