Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
//import koa
var Koa = require('koa');
//import all the routes
var special = require('./routes/welcome');
var admin = require('./routes/admin');
var articles = require('./routes/articles.js');
//create a koa instance and store it in app variable
var app = new Koa();
////apply the routes as a middleware
app.use(special.routes());
app.use(articles.routes());
//if there is no environment variable set for port number
//use a default value of 3000
var port = process.env.PORT || 3000;
//run the werver on port 3000
app.listen(port);