DefaultController.js 551 B

1234567891011121314151617181920212223242526272829
  1. "use strict";
  2. var Controller = require('./../framework/Controller.js');
  3. class DefaultController extends Controller {
  4. //var i = 0;
  5. constructor(req, res) {
  6. super(req, res);
  7. this.i = 0;
  8. }
  9. actionIndex(args) {
  10. var title = args['title'] || 'Hello';
  11. this.assign('title', title);
  12. this.display('index');
  13. }
  14. actionTest(args) {
  15. this._res.write(this.i++ + "");
  16. this._res.end();
  17. }
  18. actionWs(args) {
  19. this.display('ws');
  20. }
  21. }
  22. module.exports = DefaultController;