Skip to content
Snippets Groups Projects
Select Git revision
  • 31965a48a64436ce2be47e7989201cd8f135b604
  • master default
  • undefined
3 results

utils.c

Blame
  • Forked from sce213ta / mysh-1
    Source project has a limited visibility.
    index.js 720 B
    const express = require('express');
    const { createProxyMiddleware } = require('http-proxy-middleware');
    const path = require('path');
    
    const app = express();
    
    // API 요청을 위한 프록시 설정
    // app.use('/api', createProxyMiddleware({
    //     target: 'http://localhost:8080',
    //     changeOrigin: true,
    //     // secure: true
    // }));
    
    // 정적 파일 제공
    app.use(express.static(path.join(__dirname, 'build')));
    
    // 모든 나머지 요청을 index.html로 리디렉트
    app.get('*', (req, res) => {
        res.sendFile(path.join(__dirname, 'build', 'index.html'));
    });
    
    // const PORT = process.env.PORT || 3000;
    app.listen(80, () => {
        console.log(`Server is running on port 80`);
    });