SHARE
TWEET

Untitled

a guest Jul 19th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top