ประสบปัญหา มี web app ตัวหนึ่งที่ต้องการ เข้าคุยด้วย https แต่เรา ดันมีเว็บที่รองรับได้แค่ http ทีนี้เราจะทำอย่างไรดีหละ ?

มี web application ที่เข้าด้วย http ชื่อ Kafdrop จะเป็นตัวทดลองใน lab ครั้งนี้

ภาพตัวอย่าง web application ที่เข้าถึงด้วย http only

ปกติ จะเข้าด้วย http://192.168.88.208:9000 เราต้องการให้เข้าผ่าน https port 443 https://192.168.88.208

ได้เรื่องละ เริ่มต้นค้นหาด้วยคำว่า http to https แล่วก็พอว่า nginx ก็ทำได้นินา สังสัยเราต้องทำลองเปิด lab ซะแล้ว


Exercise 1: สร้าง Azure resources

Task 1: เปิด Azure portal

  1. เปิด browser ไปที่ portal (https://portal.azure.com).
  2. ใส่ password Microsoft account ของคุณ แล้ว Sign in.
  3. สร้าง Resource Groups ภายใต้ Subscription

Task 2: สร้าง Storage account

  1. ใน Azure portal’s เลือกหา, select All services. หรือ search เลือกหา Storage Accounts
  2. On the Storage accounts blade, select New.
  3. in Basics tab ใส่ เลือก Subscription ,Resource Group
  4. ในส่วน Storage account name text box, enter asyncstor[yourname]**
  5. ในส่วน Location list, เลือก region ที่เหมาะสม
  6. ในส่วน Performance section, เลือกเป็น Standard
  7. ในส่วน Redundancy list, เลือกเป็น Locally-redundant storage (LRS)
  8. ที่เหลือ default ไป แล้วกด Review + Create

มาทำ unit test Angular cli บน Docker กันเถอะ

สืบเนื่องมาจากติดปัญหา ได้มีโอกาสได้นำ angular ไป deploy และต้องใช้ Jenkins ประเด็นคือ มี stage นึง ที่เป็น unit-test เรื่องจึงเกิดขึ้น (งานเข้าละ !!)

จากที่ได้ลองทำมา ขอจดบันทึกไว้หน่อย กันลืมก็แล้วกัน unittest ของ angular โดยปกติ เราจะใช้ Karma , Jasmine และอื่นๆ ทำงานร่วมกันบน browser อย่างที่ชาว developer รู้จักกันดี มันเป็น framework front-end

หลักการง่ายๆพางง ก็คือ พอจะไปบน automate deploy ด้วย CI/CD จึงต้องทำให้อยู่รูปแบบ Chrome-headless ซึ่งโดยปกติ ใครทีไหนจะมี browser ให้เปิดบนนั้นกันเล่า

เราลองมาเริ่มต้นง่ายๆ

1. สร้าง Project angular cli สำหรับใคร ไม่รู้ทำไง อย่างลอง ตามนี้ https://cli.angular.io/

2. ได้ project ใหม่แล้วมาสร้าง Custom file Dockerfileใหม่กัน (ไว้ root path นะ)

อธิบายเพิ่มเติม : ได้มีการนำ base image ของ nodejs มา custom ต่อ จากนัั้น install package ที่จำเป็นต้องใช้ลงไป (xvfb, dbus ) https://www.x.org/releases/X11R7.6/doc/man/man1/Xvfb.1.xhtml

จากนั้นติดตั้งในส่วน browser chrome…


I want capture log from standard out using FluentD but i will found format log isn’t work !

เปลี่ยน log springboot ให้ออกเป็น JSON อย่างง่าย

I want use JSON Format from spring boot app so , “Easy Solution” i will show you how to Convert STOUT Log format Json

basically application log out format

default stdout log format

TO


เรื่องมีอยู่ว่า พี่หมีได้หลงป่า อยากจะทดสอบว่า เสียงร้องของพี่หมีแต่ละตัวดังยังไงเอาล่ะทีนี้เรามาช่วยพี่หมีทดสอบกันดีกว่า

facebook.com/พี่หมีใจดี-31970452210547

ก่อนอื่นพี่หมีต้องการดื่มสักแก้ว ?

Bokie Tarathep

Hey, I am Bokie Tarathep. A full stack software developer. I love researching new technology science anime game and another world. tarathep.com

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store