Skip to content

Instantly share code, notes, and snippets.

@Odomhae
Created January 9, 2020 16:15
Show Gist options
  • Save Odomhae/3c7d498bd0d52aae1595ecee571339e6 to your computer and use it in GitHub Desktop.
Save Odomhae/3c7d498bd0d52aae1595ecee571339e6 to your computer and use it in GitHub Desktop.
var express = require('express');
var path = require('path');
var logger = require('morgan');
var indexx = require('./routes/index');
var app = express();
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'ejs');
console.log('view engine is set as ejs');
// set path for static assets
//app.use(express.static(path.join(__dirname, 'public')));
console.log('122ejs');
// routes
app.use('/', indexx);
console.log('1s ejs');
// catch 404 and forward to error handler
/*app.use(function(req, res, next) {
var err = new Error('Not Found');
err.status = 404;
next(err);
});
// error handler
app.use(function(err, req, res, next) {
// render the error page
res.status(err.status || 500);
res.render('error', {status:err.status, message:err.message});
});
*/
//module.exports = app;
app.listen(3000,function(){
console.log('example is starteed!');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment