wind7 64 setup appjs

新买了台笔记本,新安装了系统,,就测试下安装 appjs

1。安装 python 2.7x 版本

2.npm install node-gyp -g

3.设置环境变量

NODE_PATH

  C:\Users\Administrator\node_modules;

4.npm install appjs

5.设置环境变量

PATH

  C:\Users\Administrator\node_modules\appjs\deps\cef\Release;

6.RUN

  node test.js

var appjs = require('appjs');

var window;

// Initialize appjs.
var app = appjs.init();

// Called when page load finishes.
app.on("ready",function(){
    console.log("Event Ready called");

    // Runs a script in browser context.
    window.runInBrowser(function(){
        var body = document.body;
        body.style.color="#f60";
    });

  // Show created window ( see below )
  window.show();
});

// Routing:

// you can use a static router:
// app.use(app.staticRouter('./public'));

// or you can handle requests manually:
app.get("/",function(req,res,next){
  res.send("\
    <html>\
        <head><title>Hello World</title></head>\
        <body>Hello World</body>\
    </html>\
  ")
});

// Creates a new window. Its invisible until window.show() get called.
// http://appjs/ is a special url. It is home for your application!
window = app.createWindow("http://appjs/",{autoResize:false});
原文地址:https://www.cnblogs.com/solq/p/2560226.html