Skip to content

012e/DailyDesk

Repository files navigation

DailyDesk

Cách chạy

Lần đầu chạy sẽ cần cài đặt pnpm. Chạy lệnh sau:

npm install -g pnpm@latest

Sau đó chạy dự án bình thường:

  1. Cài đặt dependency:
pnpm install
  1. Cập nhật database
pnpm update-db
  1. Chạy code:
pnpm dev

Trang web giờ đang ở http://localhost:5173.

Cách gọi api

Trước hết ta xem có API nào để gọi. Có thể truy cập trang http://localhost:5173/doc để xem danh sách tất cả API của backend. image

Sau khi biết có API thì sử dụng httpClient từ @/lib/client

import { Button } from "./components/ui/button";
import httpClient from "@/lib/client";

function App() {
  async function doSomething() {
    console.log("api result: ", await httpClient.get("/boards"));
  }
  return (
    <div>
      <h1>Welcome to the App!</h1>
      <Button onClick={doSomething}>Hello</Button>
    </div>
  );
}

export default App;

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 5

Languages