Advertisement
Guest User

Untitled

a guest
Jul 19th, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.42 KB | None | 0 0
  1. //백엔드와 프론트엔드 폴더가 완전히 분리되어 있는 상태이다.
  2. const express = require('express');
  3. const path = require('path');
  4. const app = express();
  5.  
  6. const staticPath = path.join(__dirname, '../frontend/build')
  7.  
  8. console.log(staticPath)
  9.  
  10. app.use(express.static(staticPath));
  11.  
  12. app.get('/', function(req, res) {
  13. res.sendFile(path.join(__dirname, '../frontend/build', 'index.html'));
  14. })
  15.  
  16. app.listen(8000);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement