小编sta*_*.js的帖子

TypeScript或CoffeeScript

开始使用node.js构建Web应用程序.

我的一位同事询问了TypeScript,它是Microsoft的一种新语言.我们计划用node.js和TypeScript作为Scripting引擎启动我们的新Web应用程序.

我只想知道是时候使用TypeScript开发应用程序了吗?TypeScript的未来如何?

node.js coffeescript typescript

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

OpenGL向后兼容性

我购买了支持OpenGL 4.2的显卡.但我想开发一个应该支持OpenGL 2.0的应用程序

我的卡是否支持OpenGL 2.0应用程序(向后兼容性)?那么如何确保向后兼容性

我计划使用GLUT/GLFW C++库.

c++ opengl video-card

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

使用node.js进行丰富的应用开发

我是node.js的新手,已经要求使用Node.js开发基于Web的丰富应用程序.

现在我正在研究node.js上的入门指南.我有机会在这里查看页面并与数百个框架混淆.我不知道选择合适的框架,需要帮助才能做出完美的决定.让我解释一下我的要求.

  1. 想要为所有功能开发RESTfull API.(OAuth上的任何库?)
  2. 想要在API之上开发Web应用程序.应用程序必须以这样的方式设计,即应在客户端开发主要功能.意味着,所有业务逻辑都必须在客户端开发.我听说像Backbone.js,Underscore.js这样的库已经完成了这项工作,但对它没有明确的想法.

请建议我哪些框架能更好地满足我的要求.

谢谢,

javascript node.js

5
推荐指数
1
解决办法
3611
查看次数

来自 Node.js 的 postgres 连接

我在我的应用程序中使用node-postgres。我想知道我想要遵循的最佳实践以确保稳定的连接。

以下是我现在使用的代码,

exports.getAll = function (args, callback) {
helper.client = new pg.Client('tcp://postgres:system6:5432@192.168.143.11/abc_dev');
helper.client.connect();
helper.client.query('select count(1) as total_records from facilities', function(err,response){
    helper.client.query('select * ,'+response.rows[0].total_records+' as total_records  from facilities', 
        function(err,response){
            callback(response);
            helper.client.end.bind(helper.client);
        });
    });
};
Run Code Online (Sandbox Code Playgroud)

正如您在代码中看到的,我为每个请求连接数据库,并在查询执行后断开连接。我还有一个想法,我可以仅全局连接一次数据库并使用打开的连接执行查询。代码看起来像

helper.client = new pg.Client('tcp://postgres:system6:5432@192.168.143.11/abc_dev');
helper.client.connect();

exports.getAll = function (args, callback) {
helper.client.query('select count(1) as total_records from facilities', function(err,response){
    helper.client.query('select * ,'+response.rows[0].total_records+' as total_records  from facilities', 
        function(err,response){
            callback(response);
        });
    });
};
Run Code Online (Sandbox Code Playgroud)

这里的联系永远不会结束。据我所知,我无法决定哪一个最好。请建议。

谢谢..

node.js node-postgres

5
推荐指数
1
解决办法
5487
查看次数

node.js的模板引擎

我想知道node.js的最佳模板引擎.目前我正在使用带有node.js的jade引擎.

阅读本文后出现了混乱

https://github.com/baryshev/template-benchmark

请建议我最好的

谢谢.

javascript performance node.js

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