ลองเล่น Bun และ ElysiaJS กัน
mikelopster
@mikelopsterAbout
Where Hipster Meets Code. Making Complex Simple! ผมเป็นเพียงชายคนหนึ่งที่รักในการเขียนและเล่าเรื่องราวผ่านการ coding อะไรที่เกี่ยวกับ programming เราจะจัดให้คุณเอง ! 😁 "Trust you intuition จงเชื่อในสัญชาตญาณของตัวคุณเอง" ติดตามเราที่ช่องทางอื่นๆได้เช่นกัน - Facebook: https://www.facebook.com/mikelopster.dev - Website: https://mikelopster.dev/ - My personal documents and notes: https://docs.mikelopster.dev/
Latest Posts
Video Description
☕️ สนับสนุนช่องเราด้วยการสมัครสมาชิกช่องทางนี้ได้เลย https://www.youtube.com/channel/UC3YgTINPYQmUcRt5ZcNFIZQ/join ลองไมค์ สัปดาห์นี้ เรามาพาเล่น Runtime ตัวใหม่ (ที่คนพูดถึงกันเยอะพอสมควรหลังจากที่มีการปล่อย version 1.0 ในช่วงปีนี้ที่ผ่านมา) “Bun” มารู้จักกับ Bun กันว่ามันคืออะไร มันส่งผลทำให้ Application ที่พัฒนาด้วย Javascript สามารถไวขึ้นยังไงได้บ้าง รวมถึง “ElysiaJS” web framework ที่ใช้งานคู่กัน Bun runtime กันว่า เราสามารถพัฒนางาน Web Application บน Bun ผ่าน ElysiaJS ยังไงได้บ้าง มารู้จักกันในลองไมค์วันนี้กัน โดยในหัวข้อนี้เราจะพูดถึง 1. ทำความรู้จัก Runtime กับ Bun 2. ทำ CRUD กับ Bun ผ่าน library SQLite ของ Bun 3. เล่า ElysiaJS แต่ละ feature ให้ฟัง (แตกต่างกับ express ยังไง) 4. การพัฒนา Web API ผ่าน ElysiaJS (เคสทั่วไปอย่าง CRUD, Authentication) 5. Deploy งาน Bun ขึ้น Cloud run (มาทดลอง Deploy Bun กัน) หัวข้อ 00:00 แนะนำหัวข้อ 01:50 Runtime คืออะไร ? 07:49 แนะนำ Bun 11:21 จุดขายของ Bun - all in one runtime 13:10 Bun และ Node.js compatibility 15:50 Bun install 17:59 ลองสร้าง HTTP Server ผ่าน Bun 19:51 แนะนำ ElysiaJS 23:50 เราจะทำอะไรกับ ElysiaJS บ้าง 24:54 เริ่มสร้าง project ElysiaJS สำหรับ HTTP Server 27:50 เริ่มทำ model.ts สำหรับการต่อเข้ากับ SQLite 30:41 ทำการสร้าง table ใน SQLite ผ่าน DB Browser 32:50 ทำการ SELECT Query ผ่าน Bun 33:30 ทำ CRUD function ของ Book SQLite 41:04 ทำ createUser และ getUser สำหรับเตรียมทำ login / register 43:42 นำ model.ts ไปใช้งานที่ฝั่ง ElysiaJS (ทดลองจาก getBooks) 45:52 ElysiaJS - POST /books สำหรับสร้าง Book (รับข้อมูลผ่าน body) 50:49 ElysiaJS - เพิ่ม handle error (จัดการ response code) 52:36 ElysiaJS - GET /books/:id รับค่าผ่าน params 53:45 ElysiaJS - PUT /books/:id แก้ไข Book 55:14 ElysiaJS - DELETE /books/:id ลบ Book 56:30 ElysiaJS - เพิ่ม validate schema 1:00:02 เริ่มต้นเพิ่ม Login ด้วย cookie และ jwt 1:01:03 ElysiaJS - เพิ่ม POST /register สำหรับเพิ่ม User (เข้ารหัส Password) 1:03:30 ElysiaJS - เพิ่ม POST /login เช็ค User (เช็คการเข้ารหัส) 1:07:02 ElysiaJS - เพิ่ม plugin jwt และ cookie (ใช้ .env) 1:09:20 ElysiaJS - จังหวะ login เพิ่มการใส่ jwt token ไปใน cookie 1:10:38 ElysiaJS - เพิ่มการดึงข้อมูลจาก jwt 1:12:13 ElysiaJS - เพิ่มการเช็ค token โดยการใช้ derive (แนะนำ store, decorate, derive) 1:15:13 ElysiaJS - เพิ่ม beforeHook เช็ค Login ก่อนถึงจะใช้งาน API /books ได้ (แนะนำ hook) 1:19:09 ElysiaJS - เพิ่ม guard ดักกับทุก API ตระกูล /books 1:21:08 สรุปทั้งหมดของ ElysiaJS 1:22:13 เพิ่ม swagger 1:23:34 แนะนำ Eden 1:24:12 Deploy bun บน Google cloud run 1:33:33 สรุปหัวข้อ และ แชร์เรื่อง Bun เพิ่มเติม ฉบับ Document https://mikelopster.dev/posts/elysiajs-bun ใครมีข้อสงสัยเพิ่มเติม มาพูดคุยแลกเปลี่ยนความรู้กันได้ที่ Facebook page: https://www.facebook.com/mikelopster.dev กันได้เลย พิกัดของด้านหลัง : https://shope.ee/8A54c8cfkf Enjoy ครับ 😘
Upgrade Your Everyday
AI-recommended products based on this video

Amazon Echo Show 8 (newest model), With Spatial Audio, Smart Home Hub, and Alexa, Charcoal

Apple AirPods 4 Wireless Earbuds, Bluetooth Headphones, with Active Noise Cancellation, Adaptive Audio, Transparency Mode, Personalized Spatial Audio, USB-C Charging Case, Wireless Charging, H2 Chip

Wireless Earbuds, Bluetooth 5.4 Headphones, True Wireless Stereo Earphones with IPX7 Waterproof, Noise Cancelling Mic, Fast Charging and Comfort Fit Ear Buds for Sports/Workouts - Black

Apple AirPods 4 Wireless Earbuds, Bluetooth Headphones, Personalized Spatial Audio, Sweat and Water Resistant, USB-C Charging Case, H2 Chip, Up to 30 Hours of Battery Life, Effortless Setup for iPhone

Apple AirPods Pro 2 Wireless Earbuds, Active Noise Cancellation, Hearing Aid Feature, Bluetooth Headphones, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

Smart Watch for Men/Women, 1.95" AMOLED Fitness Tracker Watches with Bluetooth Calls/Flashlight/100+ Sport Modes Heart Rate/Sleep Monitor Ultra Lightweight Ultrathin Design

Smart Watch for Men Women (Answer/Make Call), 1.96" HD Smartwatch Fitness Activity Tracker, 110+ Sports IP68 Waterproof, Heart Rate/Sleep Monitor/Pedometer/Calories, Fitness Watch for Android iOS
![Apple Watch Series 10 [GPS 46mm case] Smartwatch with Rose Gold Aluminium Case with Light Blush Sport Band - M/L. Fitness Tracker, ECG App, Always-On Retina Display, Water Resistant](https://m.media-amazon.com/images/I/61nNNMI1cFL._AC_UL960_FMwebp_QL65_.jpg)
Apple Watch Series 10 [GPS 46mm case] Smartwatch with Rose Gold Aluminium Case with Light Blush Sport Band - M/L. Fitness Tracker, ECG App, Always-On Retina Display, Water Resistant
![Apple Watch Series 10 [GPS 42mm case] Smartwatch with Jet Black Aluminium Case with Black Sport Band - S/M. Fitness Tracker, ECG App, Always-On Retina Display, Water Resistant](https://m.media-amazon.com/images/I/6105jZyXyPL._AC_UL960_FMwebp_QL65_.jpg)
Apple Watch Series 10 [GPS 42mm case] Smartwatch with Jet Black Aluminium Case with Black Sport Band - S/M. Fitness Tracker, ECG App, Always-On Retina Display, Water Resistant

NOCO Boost GB40: 1000A UltraSafe Jump Starter – 12V Lithium Battery Booster Pack, Portable Jump Box, Power Bank & Jumper Cables - for 6.0L Gas and 3.0L Diesel Engines

UGREEN Nexode Power Bank 20000mAh 130W Portable Charger 72Wh PD Fast Charging 3-Port USB C Battery Pack with TFT Smart Display for MacBook/iPad/iPhone 16/Samsung S24 and More

ANKER 737 Power Bank, 24,000mAh 3-Port Laptop Portable Charger with 140W Fast Charging, Smart Display, for Outdoor Work, Compatible with iPhone 16/15/14 Series, Vision Pro, Samsung, MacBook, and More

VOLTME Portable Charger, Slim 10000mAh 5V/3A Power Bank, USB C in&Out High-Speed Charging Battery Pack, Travel Essentials Dual Output Compatible with iPhone 16 15 14 13 12 Samsung Google iPad etc

Apple AirPods 4 Wireless Earbuds, Bluetooth Headphones, with Active Noise Cancellation, Adaptive Audio, Transparency Mode, Personalized Spatial Audio, USB-C Charging Case, Wireless Charging, H2 Chip

Apple AirPods 4 Wireless Earbuds, Bluetooth Headphones, Personalized Spatial Audio, Sweat and Water Resistant, USB-C Charging Case, H2 Chip, Up to 30 Hours of Battery Life, Effortless Setup for iPhone

Apple AirPods Pro 2 Wireless Earbuds, Active Noise Cancellation, Hearing Aid Feature, Bluetooth Headphones, Transparency, Personalized Spatial Audio, High-Fidelity Sound, H2 Chip, USB-C Charging

Bose QuietComfort Bluetooth Headphones, Wireless Headphones with Active Over Ear Noise Cancelling and Mic, Deep Bass, Up to 24 Hours of Playtime, White Smoke

Barnyard Designs Indoor Herb Garden Planter Set with Tray, Metal Windowsill Plant Pots with Drainage for Outdoor or Indoor Plants, Set/3 (Black)

Eye Contact Web Camera for Desktop Computer – 1080P USB Camera with Microphone & Stand, Center Cam for Laptop or Desktop, Manual Focus, Plug & Play for macOS & Windows(Black)
![PEHAEL 3+3Pack for iPhone 17 Pro Max Privacy Screen Protector with Camera Lens Protector Full Coverage Anti-Spy Tempered Glass Film 9H Hardness Easy Installation Bubble Free [6.9 inch]](https://m.media-amazon.com/images/I/61PnVkv6KKL._AC_UL960_FMwebp_QL65_.jpg)
PEHAEL 3+3Pack for iPhone 17 Pro Max Privacy Screen Protector with Camera Lens Protector Full Coverage Anti-Spy Tempered Glass Film 9H Hardness Easy Installation Bubble Free [6.9 inch]
![Ailun 3 Pack Screen Protector for iPhone 16 Pro Max [6.9 inch] + 3 Pack Camera Lens Protector with Installation Frame,Sensor Protection,Dynamic Island Compatible,Case Friendly Tempered Glass Film](https://m.media-amazon.com/images/I/815keamN-BL._AC_UL960_FMwebp_QL65_.jpg)
Ailun 3 Pack Screen Protector for iPhone 16 Pro Max [6.9 inch] + 3 Pack Camera Lens Protector with Installation Frame,Sensor Protection,Dynamic Island Compatible,Case Friendly Tempered Glass Film




