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


TypeScript express.bodyParser函数代码示例

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


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

示例1:

 app.configure(function () {
     app.set('view engine', 'ejs');
     app.engine('.html', engine.renderFile);
     app.use(express.bodyParser());
     app.use(express.methodOverride());
     app.use(express.static('public'));
 });
开发者ID:Semigradsky,项目名称:Batla,代码行数:7,代码来源:server.ts

示例2:

app.configure(function () {
    console.log("app.configure");
    app.use(express.bodyParser());
    app.set('views', __dirname + '/views');
    app.set('view engine', 'ejs');
    app.use(express.static(__dirname + '/public'));
});
开发者ID:acrobat888,项目名称:NodeJS,代码行数:7,代码来源:nockmarket.ts

示例3: intializeWebServer

 private intializeWebServer() {
     this.app = express();
     this.app.use(express.bodyParser());
     this.app.use('/', express.static(__dirname + '/content'));
     this.app.post('/api/signup', this.signup.bind(this));
     this.app.get('/api/:username/:queue', this.getMessages);
     this.app.post('/api/:username/:queue', this.sendMessage);
 }
开发者ID:FlatlinerDOA,项目名称:OpenQ,代码行数:8,代码来源:openq-express.ts

示例4:

app.configure(function () {
    app.use(express.static('public'));
    app.use(express.cookieParser());
    app.use(express.bodyParser());
    app.use(express.session({ secret: 'keyboard cat' }));
    app.use(passport.initialize());
    app.use(passport.session());
    app.use(app.router);
});
开发者ID:dpwolfe,项目名称:nko4-siecieborowice,代码行数:9,代码来源:server.ts

示例5:

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

示例6:

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

示例7:

    app.configure(function () {
        app.use(express.bodyParser());
        app.use(express.static(__dirname + '/public'));

        app.get('/api/todo', routes.getallTodoes);        
        app.get('/api/todo/MetaData', routes.getMetadata);
        app.get('/api/todo/:todoid', routes.getTodoById);
        app.post('/api/todo', routes.saveChanges);

        app.get('/api/faketodo', routes.getallFakeTodoes);
        app.get('/api/faketodo/MetaData', routes.getFakeMetaData);
        app.get('/api/faketodo/:todoid', routes.getFakeTodoById);
        app.post('/api/faketodo', routes.saveFakeChanges);

    });
开发者ID:latticework,项目名称:proto-ng-breeze-edge,代码行数:15,代码来源:server.ts

示例8: express

        pause: pause,
        setupZlapser: setupZlapser,
        snap: snap,
        shutdown: shutdown,
        setScript: setScript
    }

})();


var app = express();
var theServer = http.createServer(app);
var io = require('socket.io').listen(theServer);


app.use(express.bodyParser());
app.post("/data", model.setupZlapser);
app.post("/start", model.start);
app.post("/stop", model.stop);
app.post("/pause", model.pause);
app.post("/resume", model.pause);
app.post("/snap", model.snap);
app.put("/shutdown", model.shutdown);
app.get("/readme.md", (req, res)=> {

    fs.readFile(__dirname + '/readme.md', 'utf-8', function (err, data) {
        if (err) {
            res.send("<p>Error getting readme.md</p>");
        }
        var converter = new pagedown.Converter();
        res.send(")]}',\n" + converter.makeHtml(data));
开发者ID:ziaxdk,项目名称:zlapser,代码行数:31,代码来源:server.ts

示例9: done

                        done(null, results);
                     }
                  },replace);
               }
               else {
                  if (!--pending) {
                     done(null, results);
                  }
               }
            });
         });
      });
   };


   server.use(express.bodyParser());
   server.use(express.cookieParser());
   server.use(express.compress());
   server.get('/', function (req, res) {
      res.render(path.resolve(__dirname, '../app.html'));
   });

   var cachedFiles:any[] = null;
   /**
    * A Quick demo hack for enumerating system files.  Calculate this once and cache it, because
    * it could potentially be an expensive operation, and we'll be running on slow ass free Heroku
    * servers.
    */
   server.get('/files', function (req, res) {
      if(cachedFiles){
         res.json(cachedFiles,200);
开发者ID:justindujardin,项目名称:pow-edit,代码行数:31,代码来源:server.ts

示例10: require

// .These two lines are required to initialize Express in Cloud Code.
var express = require('express');
var app = express();

// .Global app configuration section
app.set('views', 'cloud/views');  // .Specify the folder to find templates
app.set('view engine', 'ejs');    // .Set the template engine
app.use(express.bodyParser());    // .Middleware for reading request body

// .This is an example of hooking up a request handler with a specific request
// path and HTTP verb using the Express routing API.
app.get('/hello', function(req: any, res: any) {
  res.render('hello', { message: 'Congrats, you just set up your app!' });
});

// // Example reading from the request query string of an HTTP get request.
// app.get('/test', function(req, res) {
//   // GET http://example.parseapp.com/test?message=hello
//   res.send(req.query.message);
// });

// // Example reading from the request body of an HTTP post request.
// app.post('/test', function(req, res) {
//   // POST http://example.parseapp.com/test (with request body "message=hello")
//   res.send(req.body.message);
// });

app.get('/post/:objectId', function(req: any, res: any) {

开发者ID:AbeHaruhiko,项目名称:chavo,代码行数:28,代码来源:app.ts


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