This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const express = require("express"); | |
| const cors = require("cors"); | |
| const app = express(); | |
| app.use(cors()); | |
| app.use(express.json()); | |
| const users = [ | |
| { username: "test", password: "1234" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState, useEffect } from "react"; | |
| function App() { | |
| // 로그인 기능 (user 먼저 선언) | |
| const [user, setUser] = useState(null); | |
| const [username, setUsername] = useState(""); | |
| const [password, setPassword] = useState(""); | |
| // 1️) plants 상태 |