当前位置: 软件>JavaScript软件
Node.js 框架 Kiss.js
本文导语: Kiss.js 是 Node.js 的 web 框架,使用 CoffeeScript 编写,简单而带感。Kiss 是面向对象的 Node.js 框架。 示例: kiss = require "kiss.js" controllers = require "../controllers/controllers" args = process.argv.splice 2 address = "127.0.0.1" port = 1337 if args[...
Kiss.js 是 Node.js 的 web 框架,使用 CoffeeScript 编写,简单而带感。Kiss 是面向对象的 Node.js 框架。
示例:
kiss = require "kiss.js" controllers = require "../controllers/controllers" args = process.argv.splice 2 address = "127.0.0.1" port = 1337 if args[0] address = args[0] if args[1] port = parseInt args[1] my_controller = new controllers.MyController() options = application: address: address || "127.0.0.1" port: port || 1337 views: static_path: __dirname + "/../views/static/" template_path: __dirname + "/../" locale_path: __dirname + "/../views/locales/" cookie_secret: "ertyu78f020fk" urls: "/": my_controller "/user": "/posts": my_controller app = new kiss.core.application.Application(options) app.start()