Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //백엔드와 프론트엔드 폴더가 완전히 분리되어 있는 상태이다.
- const express = require('express');
- const path = require('path');
- const app = express();
- const staticPath = path.join(__dirname, '../frontend/build')
- console.log(staticPath)
- app.use(express.static(staticPath));
- app.get('/', function(req, res) {
- res.sendFile(path.join(__dirname, '../frontend/build', 'index.html'));
- })
- app.listen(8000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement