app.use('/static', express.static('public'))
The express. static() function is a built-in middleware function in Express. It serves static files and is based on serve-static. Syntax: express.static(root, [options]) Parameters: The root parameter describes the root directory from which to serve static assets
const express = require('express')
const path = require('path')
const app = express()
app.use('/public', express.static(path(__dirname) + '/public'))
// the directory '/public' represents whatever direcotory your html file is
// example: if your host naturally looks for a file named 'index.html', then
// when running this server on that host, it will look in the directory for
// 'index.html' and will automatically display it when someone goes to
// (yoursite).com. It varies from host to host.
// Otherwise, read the docs for additional options.
// http://expressjs.com/en/4x/api.html#express.static
//please read the expressjs docs
// https://expressjs.com/en/starter/static-files.html