-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,8 @@ | ||
var createError = require('http-errors'); | ||
var express = require('express'); | ||
var cookieParser = require('cookie-parser'); | ||
var logger = require('morgan'); | ||
require('dotenv').config() | ||
const express = require('express') | ||
const app = express() | ||
|
||
// middleware | ||
app.use(express.json()) | ||
const URI = process.env.MYSQL_ADDON_URI | ||
|
||
|
||
app.use(logger('dev')); | ||
app.use(express.json()); | ||
app.use(express.urlencoded({ extended: false })); | ||
app.use(cookieParser()); | ||
|
||
app.use('/', indexRouter); | ||
app.use('/users', usersRouter); | ||
|
||
// catch 404 and forward to error handler | ||
app.use(function (req, res, next) { | ||
next(createError(404)); | ||
}); | ||
|
||
// error handler | ||
app.use(function (err, req, res, next) { | ||
// set locals, only providing error in development | ||
res.locals.message = err.message; | ||
res.locals.error = req.app.get('env') === 'development' ? err : {}; | ||
|
||
// render the error page | ||
res.status(err.status || 500); | ||
res.render('error'); | ||
}); | ||
|
||
module.exports = app; | ||
app.listen() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const Seqeulize = require("seqeulize") | ||
require('dotenv').config() | ||
const URI = process.env.MYSQL_ADDON_URI | ||
|
||
|
||
const seqeulize = new Seqeulize(URI, { dialect: 'mysql' }) | ||
|
||
module.exports = seqeulize |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.