Skip to content
Snippets Groups Projects
Commit 2a483934 authored by Will Billingsley's avatar Will Billingsley
Browse files

Configured /build/public directory to appear on /public route

parent a2c092dc
No related branches found
No related tags found
No related merge requests found
import express from 'express';
import bodyParser from "body-parser";
import * as path from "path";
import * as welcome from "./controllers/welcome.controller"
const app = express()
// This enables routes expection JSON data to access it as req.body
app.use(bodyParser.json())
// This maps the /build/public directory to the /public path
app.use("/public", express.static(path.join(__dirname, "public")))
// Which port to use
const port: string = process.env.PORT || "3000"
/*
......
<!DOCTYPE html>
<html>
This file is public
</html>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment