AppJS 正在参加 2021 年度 OSC 中国开源项目评选,请投票支持!
AppJS 在 2021 年度 OSC 中国开源项目评选 中已获得 {{ projectVoteCount }} 票,请投票支持!
2021 年度 OSC 中国开源项目评选 正在火热进行中,快来投票支持你喜欢的开源项目!
2021 年度 OSC 中国开源项目评选 >>> 中场回顾
AppJS 获得 2021 年度 OSC 中国开源项目评选「最佳人气项目」 !
授权协议 MIT
开发语言 JavaScript
操作系统 跨平台
软件类型 开源软件
所属分类 程序开发GUI开发框架
开源组织
地区 不详
投 递 者 红薯
适用人群 未知
收录时间 2012-08-23

软件简介

AppJS 是一个令人振奋的 JavaScript 库,使我们能够使用 Web 技术快速开发桌面应用程序(HTML,CSS和JavaScript)。AppJS 使用 Node.js 做为后端支撑。

示例代码:

/**
 * Begin by requiring appjs.
 **/
var app = require('appjs');

// serve files to browser requests to "http://appjs/*"
app.serveFilesFrom(path.resolve(__dirname, 'public'));


/**
 * There are other routing functions that you can use like `post`, `get` or `all`.
 **/
app.post('/',function(req,res,next){
  res.send('Hey! How are you '+req.post('firstname'));
})

/**
 * Create a window and point it to http://appjs/. This url is a special url. 
 * It is not a http request. AppJS manages these requests manually using routers you define.
 **/
var window = app.createWindow('http://appjs/', {
  width           : 640,
  height          : 460,
  left            : -1,    // optional, -1 centers
  top             : -1,    // optional, -1 centers
  autoResize      : false, // resizes in response to html content
  resizable       : true, // controls whether window is resizable by user
  showChrome      : true,  // show border and title bar
  opacity         : 1,     // opacity from 0 to 1 (Linux)
  alpha           : false, // alpha composited background (Windows & Mac)
  fullscreen      : false, // covers whole screen and has no border
  disableSecurity : true   // allow cross origin requests
});

/**
 * This event is fired when window is ready and loading the first page is finished.
 **/
window.on("ready",function(){
  console.log("Event Ready called");

  this.frame.show();

});
展开阅读全文

代码

评论

点击加入讨论🔥(6) 发布并加入讨论🔥
暂无内容
发表了博客
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
发表了问答
{{o.pubDate | formatDate}}

{{formatAllHtml(o.title)}}

{{parseInt(o.replyCount) | bigNumberTransform}}
{{parseInt(o.viewCount) | bigNumberTransform}}
没有更多内容
暂无内容
暂无内容
6 评论
300 收藏
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部