'use strict';

// NOTE: NO LONGER USED

const express = require("express");
const bodyParser = require("body-parser");
const path = require("path");

const webpackDevMiddleware = require("webpack-dev-middleware");
const webpackHotMiddleware = require("webpack-hot-middleware");
const webpack = require("webpack")(require("./webpack.config.js"));

let app = express();

app.use(webpackDevMiddleware(webpack, {
	publicPath: "/"
}));

app.use(webpackHotMiddleware(webpack));

app.set("view engine", "pug");
app.set("views", path.join(__dirname, "views"));

app.use(express.static(path.join(__dirname, "public")));

app.use(bodyParser.urlencoded({
	extended: true
}));

app.use("/", require("./routes/index"));

app.listen(3000);
