17koa/base2-examples

Name: base2-examples

Owner: 17koa

Description: null

Created: 2015-12-02 15:06:12.0

Updated: 2015-12-03 10:28:23.0

Pushed: 2015-12-03 10:48:41.0

Homepage: null

Size: 7

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Getting Start

prepare
init
install --save base2
hello world

create app.js

app = require('base2')({
 debug: true,
ot:__dirname


get('/', function(req, res){
s.json({hello: 'world'});


start(3029);

run

run 1

open in browser

mount routes from folder

install express

i --save express

create app.js

app = require('base2')({
 debug: true,
ot:__dirname,
outes": "routes",


start(3029);

create routes folder

routes/index.js

express     = require('express');
router      = express.Router();

ET home page. */
er.get('/', function(req, res, next) {
res.send('respond with a routes /');


le.exports = router;

routes/users.js

express     = require('express');
router      = express.Router();

ET users listing. */
er.get('/', function(req, res, next) {
s.send('respond with a resource /users');


le.exports = router;

run

run 2

open in browser

views engine with jade

duplicate mount-routes with views-jade

install jade

i --save jade

modify app.js

app = require('base2')({
 debug: true,
ot:__dirname,
outes": "routes",
iews" : "views"


start(3029);

only add views option

run

run 3
static server
simple static server
app = require('base2')({
 debug: true,
ot:__dirname,
ublic": "public",


start(3029);

only add public option

run

run 4
static server 2

with views

run

run 5
Contributing
  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request
????
??fork???

??????????issue?????

License

this repo is released under the MIT License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.