박민정

hoxy..

{
"files": {
"main.css": "/static/css/main.c9112ef1.chunk.css",
"main.js": "/static/js/main.30dbcb82.chunk.js",
"main.js.map": "/static/js/main.30dbcb82.chunk.js.map",
"main.js": "/static/js/main.53397765.chunk.js",
"main.js.map": "/static/js/main.53397765.chunk.js.map",
"runtime~main.js": "/static/js/runtime~main.a8a9905a.js",
"runtime~main.js.map": "/static/js/runtime~main.a8a9905a.js.map",
"static/css/2.b6ac9e22.chunk.css": "/static/css/2.b6ac9e22.chunk.css",
"static/js/2.4d47edc8.chunk.js": "/static/js/2.4d47edc8.chunk.js",
"static/js/2.4d47edc8.chunk.js.map": "/static/js/2.4d47edc8.chunk.js.map",
"index.html": "/index.html",
"precache-manifest.16488c9b14dd1aef91bfa2340fd902da.js": "/precache-manifest.16488c9b14dd1aef91bfa2340fd902da.js",
"precache-manifest.ed18e22bdef77bdd64652676558ebe94.js": "/precache-manifest.ed18e22bdef77bdd64652676558ebe94.js",
"service-worker.js": "/service-worker.js",
"static/css/2.b6ac9e22.chunk.css.map": "/static/css/2.b6ac9e22.chunk.css.map",
"static/css/main.c9112ef1.chunk.css.map": "/static/css/main.c9112ef1.chunk.css.map"
......
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"/><title>약 배달 서비스 : 약사</title><link href="/static/css/2.b6ac9e22.chunk.css" rel="stylesheet"><link href="/static/css/main.c9112ef1.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.4d47edc8.chunk.js"></script><script src="/static/js/main.30dbcb82.chunk.js"></script></body></html>
\ No newline at end of file
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="shortcut icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><link rel="manifest" href="/manifest.json"/><link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.1/dist/css/bootstrap.min.css" integrity="sha384-+0n0xVW2eSR5OomGNYDnhzAbDsOXxcvSN1TPprVMTNDbiYZCxYbOOl7+AMvyTG2x" crossorigin="anonymous"/><title>약 배달 서비스 : 약사</title><link href="/static/css/2.b6ac9e22.chunk.css" rel="stylesheet"><link href="/static/css/main.c9112ef1.chunk.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div><script>!function(l){function e(e){for(var r,t,n=e[0],o=e[1],u=e[2],f=0,i=[];f<n.length;f++)t=n[f],p[t]&&i.push(p[t][0]),p[t]=0;for(r in o)Object.prototype.hasOwnProperty.call(o,r)&&(l[r]=o[r]);for(s&&s(e);i.length;)i.shift()();return c.push.apply(c,u||[]),a()}function a(){for(var e,r=0;r<c.length;r++){for(var t=c[r],n=!0,o=1;o<t.length;o++){var u=t[o];0!==p[u]&&(n=!1)}n&&(c.splice(r--,1),e=f(f.s=t[0]))}return e}var t={},p={1:0},c=[];function f(e){if(t[e])return t[e].exports;var r=t[e]={i:e,l:!1,exports:{}};return l[e].call(r.exports,r,r.exports,f),r.l=!0,r.exports}f.m=l,f.c=t,f.d=function(e,r,t){f.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:t})},f.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},f.t=function(r,e){if(1&e&&(r=f(r)),8&e)return r;if(4&e&&"object"==typeof r&&r&&r.__esModule)return r;var t=Object.create(null);if(f.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:r}),2&e&&"string"!=typeof r)for(var n in r)f.d(t,n,function(e){return r[e]}.bind(null,n));return t},f.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return f.d(r,"a",r),r},f.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},f.p="/";var r=window.webpackJsonp=window.webpackJsonp||[],n=r.push.bind(r);r.push=e,r=r.slice();for(var o=0;o<r.length;o++)e(r[o]);var s=n;a()}([])</script><script src="/static/js/2.4d47edc8.chunk.js"></script><script src="/static/js/main.53397765.chunk.js"></script></body></html>
\ No newline at end of file
......
self.__precacheManifest = (self.__precacheManifest || []).concat([
{
"revision": "d9dcd4703f5c7de8e5597152c1420acf",
"revision": "893edd1e601abaa38178d56e61a9ed06",
"url": "/index.html"
},
{
......@@ -8,7 +8,7 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/css/2.b6ac9e22.chunk.css"
},
{
"revision": "176d56469d43bf1341fe",
"revision": "cdbaada5321baee264a1",
"url": "/static/css/main.c9112ef1.chunk.css"
},
{
......@@ -16,8 +16,8 @@ self.__precacheManifest = (self.__precacheManifest || []).concat([
"url": "/static/js/2.4d47edc8.chunk.js"
},
{
"revision": "176d56469d43bf1341fe",
"url": "/static/js/main.30dbcb82.chunk.js"
"revision": "cdbaada5321baee264a1",
"url": "/static/js/main.53397765.chunk.js"
},
{
"revision": "42ac5946195a7306e2a5",
......
......@@ -14,7 +14,7 @@
importScripts("https://storage.googleapis.com/workbox-cdn/releases/4.3.1/workbox-sw.js");
importScripts(
"/precache-manifest.16488c9b14dd1aef91bfa2340fd902da.js"
"/precache-manifest.ed18e22bdef77bdd64652676558ebe94.js"
);
self.addEventListener('message', (event) => {
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
......@@ -10,6 +10,7 @@ import {
ON_SUCCESS_BUY_USER
} from './types';
import { USER_SERVER } from '../components/Config.js';
import { PRODUCT_SERVER } from '../components/Config.js';
export function registerUser(dataToSubmit) {
const request = axios.post(`${USER_SERVER}/register`, dataToSubmit)
......@@ -65,7 +66,7 @@ export function addToCart(_id) {
export function getCartItems(cartItems, userCart) {
const request = axios.get(`/api/product/products_by_id?id=${cartItems}&type=array`)
const request = axios.get(`${PRODUCT_SERVER}/products_by_id?id=${cartItems}&type=array`)
.then(response => {
......@@ -93,7 +94,7 @@ export function getCartItems(cartItems, userCart) {
export function removeCartItem(id) {
const request = axios.get(`/api/users/removeFromCart?_id=${id}`)
const request = axios.get(`${USER_SERVER}/removeFromCart?_id=${id}`)
.then(response => {
response.data.cart.forEach(item => {
......
//SERVER ROUTES
export const USER_SERVER = '3.209.242.35/api/users';
export const USER_SERVER = 'http://3.209.242.35/api/users';
export const PRODUCT_SERVER = 'http://3.209.242.35/api/product';
......
......@@ -3,7 +3,7 @@ import Dropzone from "react-dropzone";
import { Icon } from "antd";
import Axios from "axios";
import "./FileUpload.css";
import { PRODUCT_SERVER } from '../Config'
function FileUpload(props) {
const [Images, setImages] = useState([]);
......@@ -13,12 +13,12 @@ function FileUpload(props) {
header: { "content-type": "multipart/form-data" },
};
formData.append("file", files[0]);
Axios.post("/api/product/uploadImage", formData, config).then(response => {
Axios.post(`${PRODUCT_SERVER}/uploadImage`, formData, config).then(response => {
if (response.data.success) {
setImages([...Images, response.data.image]);
props.refreshFunction([...Images, response.data.image]);
} else {
alert("Failed to save the Image in Server");
alert("이미지 서버 업로드에 실패했습니다.");
}
});
};
......
......@@ -3,7 +3,7 @@ import Dropzone from 'react-dropzone'
import axios from 'axios';
import { useState } from 'react';
import './ImageUpload.css'
import { PRODUCT_SERVER } from '../Config'
function ImageUpload(props) {
const [Images, setImages] = useState([]) // 이미지를 여러장 들어가게 하기 위해서
......@@ -18,7 +18,7 @@ function ImageUpload(props) {
imageData.append("file", files[0])
// 이미지 전달
axios.post('/api/product/image', imageData, config)
axios.post(`${PRODUCT_SERVER}/image`, imageData, config)
.then(response => {
if (response.data.success) {
//console.log(response.data)
......
......@@ -5,13 +5,15 @@ import ProductImage from './Sections/ProductImage';
import ProductInfo from './Sections/ProductInfo';
import { addToCart } from '../../../_actions/user_actions';
import { useDispatch } from 'react-redux';
import { PRODUCT_SERVER } from '../../Config'
function DetailProductPage(props) {
const dispatch = useDispatch();
const productId = props.match.params.productId
const [Product, setProduct] = useState([])
useEffect(() => {
Axios.get(`/api/product/products_by_id?id=${productId}&type=single`)
Axios.get(`${PRODUCT_SERVER}/products_by_id?id=${productId}&type=single`)
.then(response => {
setProduct(response.data[0])
})
......
......@@ -4,13 +4,14 @@ import {useEffect, useState} from 'react'
import ProductImage from './Sections/ProductImage'
import ProductInfo from './Sections/ProductInfo'
import { Row, Col } from 'antd';
import { PRODUCT_SERVER } from '../../Config'
function DetailProductPages(props) {
const [Product, setProduct] = useState({})
const productId = props.match.params.prouductID
//console.log(props.match.params.prouductID) //->정상적으로 출력
useEffect(() => {
axios.get(`/api/product/products_by_id?id=${productId}&type=single`)
axios.get(`${PRODUCT_SERVER}/products_by_id?id=${productId}&type=single`)
.then(response => {
if (response.data.success) {
console.log(response.data)
......
......@@ -7,6 +7,8 @@ import { medicines, price } from "./Sections/Datas";
import SearchFeature from "./Sections/SearchFeature";
import { Container } from "react-bootstrap";
import { PRODUCT_SERVER } from '../../Config.js'
const { Meta } = Card;
function LandingPage() {
......@@ -31,7 +33,7 @@ function LandingPage() {
}, []);
const getProducts = variables => {
Axios.post("/api/product/getProducts", variables).then(response => {
Axios.post(`${PRODUCT_SERVER}/getProducts`, variables).then(response => {
if (response.data.success) {
if (variables.loadMore) {
setProducts([...Products, ...response.data.products]);
......
......@@ -3,7 +3,7 @@ import { useState } from 'react';
import { Typography, Button, Form, Input } from 'antd'; // css
import ImageUpload from '../../utils/ImageUpload'
import Axios from 'axios';
import { PRODUCT_SERVER } from '../../Config'
const { TextArea } = Input; // 박스크기 조절을 사용자가 임의로 가능하게 함.
// Select symtoms
......@@ -69,7 +69,7 @@ function UploadPage(props) {
symtoms: Option
}
Axios.post("/api/product", body)
Axios.post(`${PRODUCT_SERVER}`, body)
.then(response => {
if (response.data.success) {
alert("업로드가 완료되었습니다.");
......
......@@ -2,16 +2,16 @@ import React, { useState } from "react";
import {Button, Form, message, Input, Icon } from "antd";
import FileUpload from "../../utils/FileUpload";
import Axios from "axios";
import { PRODUCT_SERVER } from '../../Config'
const { TextArea } = Input;
const Medicines = [
{ key: 1, value: "진통제" },
{ key: 2, value: "소화제" },
{ key: 1, value: "진통제" },
{ key: 2, value: "소화제" },
{ key: 3, value: "감기약" },
{ key: 4, value: "해열제" },
{ key: 5, value: "파스류" },
{ key: 6, value: "상처치료" },
{ key: 6, value: "상처치료" },
{ key: 7, value: "기타" }
];
......@@ -46,7 +46,7 @@ function UploadProductPage(props) {
event.preventDefault();
if (!TitleValue || !DescriptionValue || !PriceValue || !MedicinesValue || !Images) {
return alert("fill all the fields first!");
return alert("모두 입력해주세요.");
}
const variables = {
......@@ -58,12 +58,12 @@ function UploadProductPage(props) {
medicines: MedicinesValue,
};
Axios.post("/api/product/uploadProduct", variables).then(response => {
Axios.post(`${PRODUCT_SERVER}/uploadProduct`, variables).then(response => {
if (response.data.success) {
alert("Product Successfully Uploaded");
alert("성공적으로 업로드 되었습니다.");
props.history.push("/");
} else {
alert("Failed to upload Product");
alert("실패했습니다.");
}
});
};
......
......@@ -2,17 +2,18 @@ import React, { Component } from 'react'
import { Typography, Button, Form, Input } from 'antd';
import axios from 'axios';
import FileUpload from '../../utils/FileUpload';
import { PRODUCT_SERVER } from '../../components/Config.js';
const { Title } = Typography;
const { TextArea } = Input;
const Medicines = [
{ key: 1, value: "진통제" },
{ key: 2, value: "소화제" },
{ key: 1, value: "진통제" },
{ key: 2, value: "소화제" },
{ key: 3, value: "감기약" },
{ key: 4, value: "해열제" },
{ key: 5, value: "파스류" },
{ key: 6, value: "상처치료" },
{ key: 6, value: "상처치료" },
{ key: 7, value: "기타" }
]
......@@ -65,7 +66,7 @@ export class UploadProductPage extends Component {
price: this.state.price
}
axios.post('/api/product/uploadProduct', variables)
axios.post(`${PRODUCT_SERVER}/uploadProduct`, variables)
.then(response => {
if (response.data.success) {
alert('성공적으로 업로드 했습니다.')
......
......@@ -10,7 +10,10 @@
"scripts": {
"start": "node server/index.js",
"build" : "cd client && npm install && npm run build",
"heroku-postbuild": "npm run build"
"heroku-postbuild": "npm run build",
"backend": "nodemon server/index.js",
"frontend": "npm run front --prefix client",
"dev": "concurrently \"npm run backend\" \"npm run start --prefix client\""
},
"author": "mindyeoi",
"license": "ISC",
......