์๋ ํ์ธ์ Foma ์ ๋๋ค.
์ด๋ฒ ๊ธ์ Node.js ์๋ฒ ์ด๊ธฐ ์ธํ ํ๋ ๋ฐฉ๋ฒ์ ๋ํด ๋ค๋ค๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค.
๋ฐ๋ก ์์ํ ๊ฒ์~
Tutorial
- React Native + Node.js + MySQL To do list ๋ง๋ค๊ธฐ 1 - ์๋ฒ ์ด๊ธฐ ์ธํ ํ๊ธฐ (Initialize server setting)
- React Native + Node.js + MySQL To do list ๋ง๋ค๊ธฐ 2 - MySQL ํ ์ด๋ธ ๋ง๋ค๊ธฐ (Create a MySQL Table)
- React Native + Node.js + MySQL To do list ๋ง๋ค๊ธฐ 3 - React Native ํ๋ฉด ๊ตฌํํ๊ธฐ (Implement frontend)
- React Native + Node.js + MySQL To do list ๋ง๋ค๊ธฐ 4 - Express๋ก CRUD ๊ตฌํํ๊ธฐ (Building a CRUD API with Express)
- React Native + Node.js + MySQL To do list ๋ง๋ค๊ธฐ 5 - Axios ์ด์ฉํ์ฌ CRUD ๊ตฌํํ๊ธฐ (Implementing a api with Axios)
Install
Node.js ์๋ฒ๋ฅผ ๋ง๋ค๊ธฐ ์ํด Node.js๋ฅผ ์ค์นํด ์ค๋๋ค.
Node.js
๋ค์ด๋ก๋ | Node.js
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
nodejs.org
VSCode๋ก ์๋ฒ ๋ง๋๋ ๊ฒ์ ์งํํ ๊ฒ์ด๋ฏ๋ก VSCode๋ฅผ ์ค์นํด ์ค๋๋ค.( ๋ค๋ฅธ IDE๋ฅผ ์ฌ์ฉํ์ ๋ ์๊ด ์์ต๋๋ค.)
Visual Studio Code
Visual Studio Code - Code Editing. Redefined
Visual Studio Code is a code editor redefined and optimized for building and debugging modern web and cloud applications. Visual Studio Code is free and available on your favorite platform - Linux, macOS, and Windows.
code.visualstudio.com
Setting
์ํ๋ ์์น์ ํด๋๋ฅผ ์์ฑํด ์ค๋๋ค.
VSCode์์ ์์์ ๋ง๋ ํด๋๋ก ์ด๋ํด ์ค๋๋ค
ํฐ๋ฏธ๋์ ์๋ก ๋ง๋ค์ด ์ค๋๋ค.
npm์ ์ด๊ธฐํ ํด์ค๋๋ค.
npm init
๊ทธ๋ฌ๋ฉด ์๋์ ๊ฐ์ด ๋ช ๊ฐ์ง ์ง๋ฌธ์ ํ ๊ฑฐ์์.
์ํ๋ ๋ด์ฉ์ ์ ๋ ฅํด๋ ๋์ง๋ง ์ด๋ฒ์๋ ๊ทธ๋ฅ ๋ชจ๋ ์ํฐ๋ง ์ณ์ package๋ฅผ ๋ง๋ค๊ฒ ์ต๋๋ค.
package.json์ด ์์ฑ ๋ฉ๋๋ค.
์ฝ๊ฒ ์๋ฒ๋ฅผ ๋ง๋๋ ๊ฒ์ ๋์์ฃผ๋ express ํ๋ ์์ํฌ๋ฅผ ์ค์นํด ์ค๋๋ค.
npm install --save express
node_modules์ package-lock.json์ด ์๊น๋๋ค.
Test
์ด์ ์ ์์ ์ผ๋ก ์๋ฒ๊ฐ ์๋ํ๋์ง ํ ์คํธ ํด๋ณด๊ฒ ์ต๋๋ค.
index.js ํ์ผ์ ๋ง๋ค์ด ์ค๋๋ค.
index.js
const express = require("express");
const app = express();
app.get("/", function (req, res) {
res.send("์๋
ํ์ธ์!");
});
app.listen(3000, () => console.log("3000ํฌํธ์์ ๋๊ธฐ ์ค..."));
์๋์ ๊ฐ์ด ๋๊ธฐ ์ค์ด๋ผ๋ ๋ก๊ทธ๊ฐ ์ฐํ๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค.
์ฃผ์์ฐฝ์ localhost:ํฌํธ๋ฒํธ๋ก ์ด๋ํ๊ฒ ๋๋ฉด ์๋์ ๊ฐ์ด "์๋ ํ์ธ์!" ๊ฐ ์ ์์ ์ผ๋ก ๋จ๋ ๊ฒ์ ๋ณผ ์ ์์ต๋๋ค.
Next Tutorial
[MySQL] React Native + Node.js + MySQL To do list ๋ง๋ค๊ธฐ 2 - MySQL ํ ์ด๋ธ ๋ง๋ค๊ธฐ (Create a MySQL Table)
Install MySQL MySQL :: Download MySQL Installer Select Operating System: Select Operating System… Microsoft Windows Select OS Version: All Windows (x86, 32-bit) Windows (x86, 32-bit), MSI Installe..
fomaios.tistory.com
Source code
์๋ ๋ ํฌ์งํ ๋ฆฌ๋ก ์ด๋ํ๋ฉด ์ ์ฒด ์์ค๋ฅผ ํ์ธํ ์ ์์ต๋๋ค.
๊ถ๊ธํ์ ์ ์์ผ์๋ฉด ์ธ์ ๋ ๋๊ธ ๋ฌ์์ฃผ์ธ์!
GitHub - fomagran/ToDoListFullStack: React native(CLI,TS) + Node.js + MySQL
React native(CLI,TS) + Node.js + MySQL. Contribute to fomagran/ToDoListFullStack development by creating an account on GitHub.
github.com
๋๊ธ