Skip to content
Snippets Groups Projects
Commit f8091739 authored by Gwangbin's avatar Gwangbin
Browse files

WIP: Ready for deploy

parent decfccfb
Branches
No related tags found
No related merge requests found
Showing
with 41 additions and 102 deletions
......@@ -20,7 +20,7 @@ lerna-debug.log*
/.nyc_output
# production
front/build
frontend/build
# IDEs and editors
/.idea
......
backend/public/uploads/istockphoto-467367026-612x6121702067093390.jpg

42.7 KiB

......@@ -14,7 +14,7 @@ import connectDB from './db.js';
const app = express();
const PORT = 8080;
const PORT = 3000;
const sessionTime = 60; // 세션시간(임시)
......@@ -29,16 +29,23 @@ app.use(session({
secure: false,
maxAge: maxAge
}
}))
app.use(
cors({
origin: 'http://localhost:3000',
credentials: true,
})
); //cors 설정을 한다..
}));
// app.use(
// cors({
// origin: 'http://localhost:3000',
// credentials: true,
// })
// ); //cors 설정을 한다..
// app.use(express.static(path.join(process.cwd(), '../public')));
app.use(express.static('public'));
app.use(express.static(path.join(process.cwd(), '../frontend/build')));
app.get('/', (req, res) => {
res.sendFile(path.join(process.cwd(), '../frontend/build', 'index.html'));
});
// app.use(express.static('public'));
app.use(cookieParser());
app.use(express.json());
......
{
"files": {
"main.css": "/static/css/main.de1ec512.css",
"main.js": "/static/js/main.2f3c2dd5.js",
"main.css": "/static/css/main.6b307083.css",
"main.js": "/static/js/main.47c6abe1.js",
"static/media/introduction.png": "/static/media/introduction.b0483eb2d8b98d0692d0.png",
"static/media/logo.png": "/static/media/logo.1be661e4a00e42d5b532.png",
"index.html": "/index.html",
"main.de1ec512.css.map": "/static/css/main.de1ec512.css.map",
"main.2f3c2dd5.js.map": "/static/js/main.2f3c2dd5.js.map"
"main.6b307083.css.map": "/static/css/main.6b307083.css.map",
"main.47c6abe1.js.map": "/static/js/main.47c6abe1.js.map"
},
"entrypoints": [
"static/css/main.de1ec512.css",
"static/js/main.2f3c2dd5.js"
"static/css/main.6b307083.css",
"static/js/main.47c6abe1.js"
]
}
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.2f3c2dd5.js"></script><link href="/static/css/main.de1ec512.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script type="text/javascript" src="//dapi.kakao.com/v2/maps/sdk.js?appkey=082d4d5803079cbcf65f5e739e63e2ae&libraries=services,clusterer,drawing"></script><title>React App</title><script defer="defer" src="/static/js/main.47c6abe1.js"></script><link href="/static/css/main.6b307083.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>
\ No newline at end of file
body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;margin:0}code{font-family:source-code-pro,Menlo,Monaco,Consolas,Courier New,monospace}button{background:inherit;background-color:#9ce8ee;border:#9ce8ee;border-radius:10px;box-shadow:none;color:#fff;cursor:pointer;height:5%;overflow:visible;padding:0;width:50%}button:hover{background-color:#8be4eb;border-color:#8be4eb}button:active{background-color:#7be0e8;border-color:#7be0e8}.App{align-items:center;display:flex;flex-direction:column;height:100vh;justify-content:center;width:100vw}.App :not(style){margin:10px}
/*# sourceMappingURL=main.de1ec512.css.map*/
\ No newline at end of file
{"version":3,"file":"static/css/main.de1ec512.css","mappings":"AAAA,KAKE,kCAAmC,CACnC,iCAAkC,CAJlC,mIAEY,CAHZ,QAMF,CAEA,KACE,uEAEF,CCZA,OACE,kBAAmB,CASnB,wBAAyB,CACzB,cAAqB,CAPrB,kBAAmB,CADnB,eAAgB,CAShB,UAAc,CALd,cAAe,CAEf,SAAU,CAHV,gBAAiB,CADjB,SAAU,CAGV,SAKF,CAEA,aACE,wBAAyB,CACzB,oBACF,CAEA,cACE,wBAAyB,CACzB,oBACF,CAGA,KAKE,kBAAmB,CAFnB,YAAa,CAGb,qBAAsB,CAJtB,YAAa,CAEb,sBAAuB,CAHvB,WAMF,CAEA,iBACE,WACF","sources":["index.css","App.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n","button {\n background: inherit;\n border: none;\n box-shadow: none;\n border-radius: 10px;\n padding: 0;\n overflow: visible;\n cursor: pointer;\n width: 50%;\n height: 5%;\n background-color: #9ce8ee;\n border-color: #9ce8ee;\n color: #ffffff;\n}\n\nbutton:hover {\n background-color: #8be4eb;\n border-color: #8be4eb;\n}\n\nbutton:active {\n background-color: #7be0e8;\n border-color: #7be0e8;\n}\n\n/* 화면 구성 초기화 */\n.App {\n width: 100vw;\n height: 100vh;\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: column;\n}\n\n.App :not(style) {\n margin: 10px;\n}"],"names":[],"sourceRoot":""}
\ No newline at end of file
This diff is collapsed.
/*! https://mths.be/base64 v1.0.0 by @mathias | MIT license */
/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
/**
* @remix-run/router v1.11.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
/**
* React Router v6.18.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/
This diff is collapsed.
......@@ -82,7 +82,7 @@ function App() {
async function requestLogout() {
const response = await axios({
url: 'http://localhost:8080/auth/logout', // 통신할 웹문서
url: 'http://localhost:3000/auth/logout', // 통신할 웹문서
method: 'get', // 통신할 방식
});
return response;
......@@ -90,7 +90,7 @@ async function requestLogout() {
async function requestCheckSession() {
const response = await axios({
url: 'http://localhost:8080/auth/session', // 통신할 웹문서
url: 'http://localhost:3000/auth/session', // 통신할 웹문서
method: 'get', // 통신할 방식
});
return response;
......
......@@ -17,11 +17,11 @@ function Article({ data }) {
}
let listItem = []
listItem = imageUrls.map((el) => {
// http://localhost:8080/uploads/21701487062905.png
// http://localhost:3000/uploads/21701487062905.png
return (
<img
src={`http://localhost:8080/${el.replaceAll("\\", "/").substring(7)}`}
alt={`http://localhost:8080/${el.replaceAll("\\", "/").substring(7)}`}
src={`http://localhost:3000/${el.replaceAll("\\", "/").substring(7)}`}
alt={`http://localhost:3000/${el.replaceAll("\\", "/").substring(7)}`}
style={{ width: "100px", height: "100px" }} />
)
});
......
......@@ -24,7 +24,7 @@ function Comments({ data }) {
function DeleteComment(e) {
const data = { id: _id }
axios
.delete(`http://localhost:8080/article/${params.id}/comment/${_id}`, data,
.delete(`http://localhost:3000/article/${params.id}/comment/${_id}`, data,
{
headers: { "Content-Type": 'application/json' }
})
......
......@@ -68,7 +68,7 @@ function b64DecodeUnicode(str) {
async function requestLogin(payloadObj) {
const response = await axios({
url: 'http://localhost:8080/auth/login', // 통신할 웹문서
url: 'http://localhost:3000/auth/login', // 통신할 웹문서
method: 'post', // 통신할 방식
data: payloadObj
});
......
......@@ -63,7 +63,7 @@ function Main() {
async function requestSortArticle(crit) {
const response = await axios({
url: `http://localhost:8080/article/?criteria=${crit}`, // 통신할 웹문서
url: `http://localhost:3000/article/?criteria=${crit}`, // 통신할 웹문서
method: 'get', // 통신할 방식
});
return response;
......
......@@ -43,7 +43,7 @@ function MyPage() {
async function requestArticles(id) {
const response = await axios({
url: `http://localhost:8080/article/user/${id}`, // 통신할 웹문서
url: `http://localhost:3000/article/user/${id}`, // 통신할 웹문서
method: 'get', // 통신할 방식
});
return response;
......
......@@ -45,7 +45,7 @@ function PostRead() {
}, []);
function SetLike() {
axios.put(`http://localhost:8080/article/${params.id}/like`)
axios.put(`http://localhost:3000/article/${params.id}/like`)
.then(res => {
return requestLoadArticleById(params.id)
})
......@@ -69,7 +69,7 @@ function PostRead() {
return
}
const data = { content: inputComment }
axios.post(`http://localhost:8080/article/${params.id}/comment`, data,
axios.post(`http://localhost:3000/article/${params.id}/comment`, data,
{
headers: { "Content-Type": 'application/json' }
})
......@@ -146,7 +146,7 @@ function PostRead() {
async function requestLoadArticleById(id) {
const response = await axios({
url: `http://localhost:8080/article/${id}`, // 통신할 웹문서
url: `http://localhost:3000/article/${id}`, // 통신할 웹문서
method: 'get', // 통신할 방식
});
return response;
......@@ -154,7 +154,7 @@ async function requestLoadArticleById(id) {
async function requestDeleteArticleById(id) {
const response = await axios({
url: `http://localhost:8080/article/${id}`, // 통신할 웹문서
url: `http://localhost:3000/article/${id}`, // 통신할 웹문서
method: 'delete', // 통신할 방식
});
return response;
......
......@@ -114,7 +114,7 @@ function PostWrite() {
formData.append("latitude", location.center.lat);
formData.append("longitude", location.center.lng);
axios
.post("http://localhost:8080/article", formData,
.post("http://localhost:3000/article", formData,
{
headers: { "Content-Type": "multipart/form-data" }
})
......
......@@ -87,7 +87,7 @@ function Search(props) {
async function requestLoadArticleByKeyword(keyword) {
const response = await axios({
url: `http://localhost:8080/article/?keyword=${keyword}`, // 통신할 웹문서
url: `http://localhost:3000/article/?keyword=${keyword}`, // 통신할 웹문서
method: 'get', // 통신할 방식
});
return response;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment