当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript express.logger函数代码示例

本文整理汇总了TypeScript中express.logger函数的典型用法代码示例。如果您正苦于以下问题:TypeScript logger函数的具体用法?TypeScript logger怎么用?TypeScript logger使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了logger函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1:

app.configure(function () {
    app.use(express.favicon());
    app.use(express.logger());
    app.use(express.bodyParser());
    app.use(express.methodOverride());
    app.use(app.router);
    app.use(express.static(path.join(application_root, "public")));
    app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
开发者ID:Sally-Xu,项目名称:Fayde.Demo,代码行数:9,代码来源:server.ts

示例2:

app.configure(()=>{
  app.set('port', process.env.PORT || 3000);
  app.set('views', __dirname + '/views');
  app.set('view engine', 'ejs');
  app.use(express.favicon());
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  app.use(express.methodOverride());
  app.use(app.router);
  app.use(express.static(path.join(__dirname, 'public')));
});
开发者ID:kaipu1224,项目名称:typescript-express,代码行数:11,代码来源:app.ts

示例3: express

var app = express();
app.get('/', function (req, res) {
    res.status(200).send('ok');
});
var server = app.listen(3000, function () {
    var port = server.address().port;
    console.log('Example app listening at port %s', port);
});


// all environments
app.set('port', process.env.PORT || 3000);
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'jade');
app.use(express.favicon());
app.use(express.logger('dev'));
app.use(express.json());
app.use(express.urlencoded());
app.use(express.methodOverride());
app.use(app.router);

import stylus = require('stylus');
app.use(stylus.middleware(path.join(__dirname, 'public')));
app.use(express.static(path.join(__dirname, 'public')));

// development only
if ('development' == app.get('env')) {
    app.use(express.errorHandler());
}

app.get('/', routes.index);
开发者ID:nrouelle,项目名称:KeepItUp,代码行数:31,代码来源:server.ts

示例4:

app.configure(function () {
    app.use(express.logger('dev')); /* 'default', 'short', 'tiny', 'dev' */
});
开发者ID:arein,项目名称:Mils-Server,代码行数:3,代码来源:app.ts

示例5: require

var renderJson = require("./renderJson");
var _ = require("underscore");


var flash = require("connect-flash");
var passport = require("passport");
var LocalStrategy = require("passport-local").Strategy;

var app = express();

app.set("port", process.env.PORT || 3000);
app.set("views", __dirname + "/views");
app.set("view engine", "jade");

app.use(express.favicon());
app.use(express.logger("dev"));
app.use(express.bodyParser());
app.use(express.cookieParser());
app.use(express.session({ secret: 'keyboard cat' }));
app.use(flash());
app.use(express.methodOverride());
app.use(passport.initialize());
app.use(passport.session());
app.use(function (req, res, next) {
    res.locals.baseUrl = "" + req.protocol + "://" + (req.get('host')) + req.path;
    var url = function (basePath : string, relPath : string) : string {
        var baseSegments, newBasePath;

        if (!relPath) {
            return basePath;
        } else if (relPath.indexOf("../") === 0) {
开发者ID:Antares007,项目名称:AiPos,代码行数:31,代码来源:app.ts


注:本文中的express.logger函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。