Commit 91d343d5 authored by Choi Ga Young's avatar Choi Ga Young
Browse files

서버

parent 13a6ac56
var createError = require('http-errors');
var express = require('express');
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
const createError = require('http-errors');
const express = require('express');
const path = require('path');
const cookieParser = require('cookie-parser');
const logger = require('morgan');
const port =3030;
require('dotenv').config();
var indexRouter = require('./routes/index');
var usersRouter = require('./routes/users');
const indexRouter = require('./routes/index');
const usersRouter = require('./routes/users');
const connect = require('./schemas');
var app = express();
const port = 3030;
const app = express();
connect();
app.listen(port, () => console.log(port));
// view engine setup
app.set('views', path.join(__dirname, 'views'));
app.set('view engine', 'pug');
app.use(logger('dev'));
app.use(express.json());
......@@ -25,6 +24,8 @@ app.use(express.static(path.join(__dirname, 'public')));
app.use('/', indexRouter);
app.use('/users', usersRouter);
app.listen(port, () => console.log(port));
// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
......
extends layout
block content
h1= message
h2= error.status
pre #{error.stack}
extends layout
block content
h1= title
p Welcome to #{title}
doctype html
html
head
title= title
link(rel='stylesheet', href='/stylesheets/style.css')
body
block content
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment