小编eca*_*eca的帖子

基于Node.js + Express的应用程序未运行iisnode

我正在使用node.js + express和iisnode进行一些实验.我有以下非常简单的应用程序,位于C:\tsapp-deploy\tsappsvr\TestExpress\0.0.0:

app.js:

var express = require('express');
var app = express();
app.use(express.static(__dirname + "/public"));

var port = process.env.PORT || 2709;
app.listen(port, function() {
  console.log('Listening on port ' + port);
});
Run Code Online (Sandbox Code Playgroud)

的package.json:

{
  "name": "TestExpress",
  "version": "0.0.0",
  "private": true,
  "dependencies": {
    "express": "3.x"
  }
}
Run Code Online (Sandbox Code Playgroud)

web.config中:

<configuration>
  <system.webServer>
    <handlers>
      <add name="iisnode" path="app.js" verb="*" modules="iisnode" />
    </handlers>
  </system.webServer>
</configuration>
Run Code Online (Sandbox Code Playgroud)

公共/ index.html的:

<!doctype html>
<html>
<head>
  <script language="javascript" type="text/javascript" src="js/jquery.js"></script>
  <script language="javascript" type="text/javascript">
    $(document).ready(function() {
      console.log("READY!");
      $("#hello").html("Hello, World!");
    });
  </script> …
Run Code Online (Sandbox Code Playgroud)

iis node.js express iisnode

8
推荐指数
2
解决办法
1万
查看次数

在简单的网页中使用SharePoint 2013跨域库:有可能吗?

我有一个托管在服务器上的网页,比如说http://SVR1/path/index.html,我希望访问托管在另一台服务器上的本地SharePoint网站上的一些列表项,比如说http://SVR2/sites/mySite/.

我正在使用的SharePoint的当前安装(不在我的控制下)不允许部署SharePoint托管的应用程序,也不允许部署托管的托管应用程序,因此我尝试使用SharePoint跨域库从纯粹访问所需的列表项外部HTML5/JS/CSS3页面.作为用户,我对SharePoint网站中的列表具有完全访问权限,因此我认为阅读其项目应该没有问题.

按照此处的示例,我的页面如下:

<!doctype html>
<html>
<head>
  <!-- Title -->
  <title>Application Template</title>
  <script language="javascript" type="text/javascript" src="js/jquery.js"></script>
  <script language="javascript" type="text/javascript">

    var hostweburl = "http://SVR2/sites/mySite";
    var appweburl  = "http://SVR1/path";

    // Load the required SharePoint libraries
    $(document).ready(function () {

      $("#renderList").html("Requesting Lists...");

      // resources are in URLs in the form:
      // web_url/_layouts/15/resource
      var scriptbase = hostweburl + "/_layouts/15";

      // Load the js files and continue to the successHandler
      $.getScript(scriptbase + "/SP.RequestExecutor.js", execCrossDomainRequest);
    });

    ///////////////////////////////////////////////////////
    // Function to prepare …
Run Code Online (Sandbox Code Playgroud)

javascript sharepoint cross-domain

7
推荐指数
1
解决办法
6469
查看次数

标签 统计

cross-domain ×1

express ×1

iis ×1

iisnode ×1

javascript ×1

node.js ×1

sharepoint ×1