Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jiren/timepass
Node.js 6 web framework (Work in progress)
https://github.com/jiren/timepass
Last synced: 8 days ago
JSON representation
Node.js 6 web framework (Work in progress)
- Host: GitHub
- URL: https://github.com/jiren/timepass
- Owner: jiren
- License: mit
- Created: 2016-07-14T19:12:36.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-07-17T06:36:07.000Z (over 8 years ago)
- Last Synced: 2024-11-06T19:55:29.561Z (about 2 months ago)
- Language: JavaScript
- Homepage: https://github.com/jiren/timepass/blob/master/test/app.js
- Size: 20.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Timepass
It is a Node.js 6(ES6) web framework (Work in progress)## How to create a first application
- Install npm package.
`npm install timepass`
```javascript
const Timepass = require('Timepass')
const App = new Timepass() // new Timepass({"port": 5000})class UsersController extends Timepass.Controller{
index(){
this.render('Users: This is INDEX page.')
}show(){
console.log(this.params)
this.render(`Users: This is SHOW page for User ${this.params.id}`)
}new(){
this.render('Users: This is NEW page.')
}create(){
this.render(this.params);
}edit(){
this.render(`Users: This is EDIT page. ${this.params.id}`)
}update(){
this.render(`Users: This is UPDATE page. ${this.params.id}`)
}destroy(){
this.render('Users: This is DESTROY page.')
}
auth(next){
if(this.params.action == 'show'){
return this.render('Auth fail', { status: 401 } )
}console.log('Auth is done')
next()
}
}
// Before actions
UsersController.beforeAction('auth')
App.defineRoutes(function(r){
r.root(UsersController, 'index')
r.resource(UsersController).resource(Orders)
//r.resource(Users, { id: 'user_id', only: ['new', 'create']})
//r.resource(Users, { id: 'user_id', except: ['new', 'create']}).resource(Orders)
})// Start server on default port 3000
TestApp.start()
```## Status
Timepass is under development, and its design is still in flux .## TODO
Here are some of the baisc things need to be developed
- [ ] App Configuration options with diffrent envs : test, development, production
- [ ] View Rendering
- [ ] Session Management
- [ ] Middlewares : Request with file, etag, session
- [ ] Request body encoding/decoding, gzip compression
- [ ] Error Pages 404, 500 etc
- [ ] Logger
- [ ] Route paths methods: user_path, edit_user_path(1)
- [ ] View Layout
- [ ] Static Pages
- [ ] Asset Managment
- AND MANY MORE THINGS