Skip to content

Commit

Permalink
Merge pull request #1 from koompi/thith
Browse files Browse the repository at this point in the history
Merge Branch Thith
  • Loading branch information
IsaacJReay committed Aug 7, 2023
2 parents 429691c + 61b929c commit bd38724
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 5 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy_client.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Auto Build Deploy Client
on:
push:
paths:
- client/**
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Run SSHPASS
run: |
sshpass \
-p ${{ secrets.SSH_PASS }} \
ssh \
-o 'StrictHostKeyChecking no' \
-p ${{ secrets.SSH_PORT }} ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} \
'cd /kmp/camprotec/cam-professional && git checkout main && git pull && cd client && npm i --force && npm run build && pm2 restart 23'
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"start": "vite",
"dev": "vite",
"build": "vite build",
"serve": "vite preview"
"serve": "vite preview",
"db": "npx json-server ./data/db.json -p 60011"
},
"license": "MIT",
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export const LatestProducts: Component<{}> = () => {

export const MainProducts: Component<{}> = () => {
const fetchData = async () => {
const res = await fetch("http://localhost:3000/CoreProducts");
const res = await fetch("http://localhost:60011/CoreProducts");
return res.json();
};
const [coreProducts] = createResource(fetchData);
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/products/details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type Product = {
};

const fetchProduct = async (id: string) => {
const res = await fetch(`http://localhost:3000/CoreProducts/` + id);
const res = await fetch(`http://localhost:60011/CoreProducts/` + id);
return res.json();
};
const ProductDetail: Component<{}> = (props) => {
Expand Down
2 changes: 1 addition & 1 deletion client/src/pages/products/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Component, For, Show, createResource } from "solid-js";
import Cards from "../../components/cards/Cards";
const fetchData = async () => {
const res = await fetch("http://localhost:3000/CoreProducts");
const res = await fetch("http://localhost:60011/CoreProducts");
return res.json();
};

Expand Down
2 changes: 1 addition & 1 deletion client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import solidPlugin from "vite-plugin-solid";
export default defineConfig({
plugins: [solidPlugin()],
server: {
port: 8000,
port: 60011,
},
build: {
target: "esnext",
Expand Down

0 comments on commit bd38724

Please sign in to comment.