dynamis
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    # JS 実習 - クラスとモジュール - class 宣言とそれ以外のクラス定義 - prototype チェインは過去のものとして使うな - ミックスイン (多重継承はナシ) - EJS とそれ以外のモジュール - EJS 以外は過去のものとして使うな - モジュールと require - 非同期処理 - all 含めて並列処理、フロー整理 - github/vercel/microCMS アカウントの作成は 10 日に指示 # Node/Express 実習 ## Node.js/NPM 基礎 - Node.js とは何か - バージョンと LTS リリースについて - 毎年春に偶数バージョンが更新され 3 年サポート - Current, Active LTS, Maintenance の違い - 最新または一つ前の偶数バージョンが基本, Active LTS 以降の方が安定 - https://github.com/nodejs/Release - package.json, node_modules - README がないとかいうな。package.lock 読め - npm - Node とセットで入る npm 使え。初心者は迷うな。 - 代替選択肢としては yarn や pnpm など - yarn は yarn.lock バージョン依存問題に注意 - pnpm は非対応ライブラリもあるし少し上級者向け - yarn がいいのは歴史的な話で取りあえず npm - npm レイオフ問題はその後 Github が買収で決着 - 参考: https://zenn.dev/hibikine/articles/27621a7f95e761 - dependencies の追加 - バージョン指定方法とバージョン依存問題 - バージョン指定は万能では無いことに注意 - 固定バージョンでもその依存先が非固定だったり - package-lock.json, dependency の固定 - 俺の手元では動かない問題 1 - package-lock があればそれをインストール - package.json と矛盾があれば package.json 優先した上で package-lock.json が上書きされる - npm ci では node_modules 削除の上で package-lock.json でインストール、package.json との矛盾をエラー出力 - npm script - 簡単にいくつか使ってみる - - node バージョン管理 - 俺の手元では動かない問題その2 - 生の node は削除していずれかのバージョン管理ツールでインストールした node だけにするのが実践的 - 古典的には nvm 一時期 nodeenv とかも - 最近増えているのは n (ネーミングセンス嫌いだが) - https://github.com/tj/n - .node-version で指定する - nvm 系は .nvmrc だが古典なので無視 - n 固有は .n-node-version もあるが無視 - Windows だと nodist か - https://github.com/nullivex/nodist ### bin と npx package.json への bin 項目の追加、npx での利用などは TIPS ではあるがあまり重要では無いと思うので割愛 ## Express 基礎 - Express とは何か - 比較対象: Fastify なども参考に - get, listen でシンプルなサーバ - ルーティング - get/post メソッドの基本的なルーティング - static 指定 - レスポンスヘッダの付与とブラウザでの確認 - CORS 対応 - express で複数オリジンサポート (ポート) - fetch をシンプルに使ってみる (失敗) - Access-Control-Allow-Origin 付与 - fetch からシンプルに使ってみる (成功) - fetch を Content-Type ヘッダ付きで使ってみる (失敗) - pre-flight とは何か - OPTION メソッドにも Access-Control-Allow-Origin 付与 - fetch を Content-Type ヘッダ付きで使ってみる (成功) - cors モジュールの利用 - 全API,個別API単位でのCORS対応 - express generator - テンプレートエンジン pug - pug の基礎と演習 - esj の方が良いかな? - ## Express のミドルウェア - Express のミドルウェアとは - 基本、使い方 - http://expressjs.com/ja/resources/middleware.html - 例: express での gzip 対応 - https://www.npmjs.com/package/compression ``` var compression = require('compression') var express = require('express') var app = express() // compress responses app.use(compression()) ``` - brotli 対応や事前圧縮済み対応は割愛... - compression では放置 https://github.com/expressjs/compression/issues/71 - 実際には CDN サーバに任せることが多い - shrink-ray モジュール古すぎマイナーになりすぎ - 参考: 事前圧縮済みstatic https://www.npmjs.com/package/express-static-gzip ## microCMS 10:00-12:00 1. 自己紹介(2分) 2. microCMSの紹介(10分) 3. microCMSでお知らせ一覧データを作成してみる(要アカウント登録)(20分) 4. Vue(またはSvelte)の紹介(20分) - create-nuxt-app でつくる 6. 3で作成したデータをフロントに表示してみる(20分) 7. 自由にスキーマを変更し、それに合わせてフロントに表示してみる(20分) ## create-nuxt-app の中身 - ざっくり出来ているものの構成 - SSR, CSR, SSG - SSG は定期更新ニュースくらいで済む場合には良いけど... - API サーバ読みつつリアルタイムなら SSR でしょ - SSR で microCSM API call - ## デプロイ 13:00-14:00 - Vercel にデプロイする - Netlify は SSR できないので今回は Vercel - SSG なら Netlify でもよい - next step: Lamda 的なことも出来るのよ ## microCSM x 自前サーバ microCMS 向けの通信を別ポートで起動する前日作った express サーバを呼ぶ ## 〆 TBD ## 資料 Keynote (概要説明、座学) + Notion (code, ワークショップ)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully