Created
June 4, 2021 19:49
-
-
Save hubgit/ab174726b3d9fabb230739f5d9fbf6fe to your computer and use it in GitHub Desktop.
Serve static files (frontend) and API routes (backend) with Express
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require('express') | |
| express().use('/api', require('./api')).use(express.static('public')).listen() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment