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
User | Most Recent Commit | # Commits |
---|
Other Committers
User | Most Recent Commit | # Commits |
---|
init
install --save base2
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
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
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
app = require('base2')({
debug: true,
ot:__dirname,
ublic": "public",
start(3029);
only add public option
run
run 4
with views
run
run 5
git checkout -b my-new-feature
)git commit -am 'Add some feature'
)git push origin my-new-feature
)i5ting
i5ting@126.com??????????issue?????
this repo is released under the MIT License.