VercelïŒvercel.appïŒ
Web ãµãŒãã¹ VercelïŒããŒã»ã«ïŒã«ã€ããŠãŸãšããŠããŸãã
2020幎 ZEIT Now ã Vercel ã«å€ãããŸããã
â² ZEIT is now Vercel | Vercel Blog
ãã¡ã€ã³ãäžæ°ããå
¬åŒ Web ãµã€ã zeit.co
㯠vercel.com
ã«å€ããã
äžè¬ãŠãŒã¶ãŒåãã®ãµããã¡ã€ã³ now.sh
ã vercel.app
ã«å€æŽãããŠããŸãã
CLI ã now
ãã vercel
ãžå€æŽãããŠããŸãã
 How do you pronounce “Vercel”? #5340 | GitHub vercel/vercel Discussions
ãVercelãã®æ£ããèªã¿ã¯âŠâŠ
- ãversatileãã®ãverãã§ãæ¥æ¬èªèªã¿ã¯ãããŒã
- ãexcelãã®ãcelãã§ãæ¥æ¬èªèªã¿ã¯ãã»ã«ã
ãããã£ãŠæ¥æ¬èªèªã¿ã»ã«ã¿ã«ãè¡šèšã¯ãããŒã»ã«ããšãªããŸãã
ç®æ¬¡
å ¬åŒã»é¢é£ãµã€ã
- â² Vercel ãã°ã€ã³ããŠããå Žå㯠Overview 衚瀺
- Â GitHub vercel
- Issues | vercel/vercel äžå ·åå ±å
- Discussions | vercel/vercel 質åãªã©
- Â Twitter @vercel
-  Vercel Status - ãµãŒã皌åç¶æ³
ãã©ã³
Vercel ã¯ç¡æã§äœ¿çšã§ããŸãã
ãã ã éå¶å©ã»å人䜿çšã«å¶éãããŸãã
å¶å©ç®çãäºæ¥åãã¯è€æ°ã¢ã«ãŠã³ãã§ã·ã§ã¢éçºã§ãã
ææãã©ã³ Proã»Enterprise ãéžæããŠäžããã
2021幎2æã«äŸ¡æ Œäœç³»ãå€ãããŸããã
ææãã©ã³ã¯äž»ã«ããŒã ã§ã®äœ¿çšåãã§ããã
転ééãã¹ãã¬ãŒãžå®¹éãªã©ã®äžéãäžãããå Žåãæ€èšãå¿
èŠã§ãããã
2022幎6æçŸåšã§ç¡æã®ãã©ã³ Hobby ã¯æ¬¡ã®ãããªå¶éããããŸãã
- 垯åå¹ : æ 100GB ãŸã§
- ãµãŒãã¬ã¹é¢æ°ã®å®è¡: 1 æé㧠100GB ãŸã§
- ãã«ãå®è¡: æ 100 æéãŸã§
- ãããã€: 1 æ¥ 100 åãŸã§
- ç¬èªãã¡ã€ã³: 50 ãã¡ã€ã³ãŸã§ â»
- ãµãŒãã¬ã¹é¢æ°ã®äœæ: ãããã€æ¯ã« 12 åãŸã§
- ãµãŒãã¬ã¹é¢æ°ã®å®è¡æé: 1 å 10 ç§ãŸã§
- Git ãªããžããªã®ããªãžã§ã¯ãæ¥ç¶: ãªããžããªæ¯ã« 3 ãããžã§ã¯ããŸã§
â» ç¬èªãã¡ã€ã³ã¯ãµããã¡ã€ã³ãã«ãŠã³ãã«å«ã¿ãŸãããsub.example.com
ã Vercel ã§äœ¿çšããå Žåã
ç¬èªãã¡ã€ã³ example.com
ã§äžã«ãŠã³ãã«ãªããŸãã
å šãã©ã³å ±éã®å¶éã¯æ¬¡ããããŸãã
- ãããã·ãªã¯ã¹ãã®ã¿ã€ã ã¢ãŠã: 30 ç§
- CLI ã«ãããããã€ã§ã®äœæ: 1 é±é㧠2000 åãŸã§
- ãããã€ãŒãã«ãæéã¿ã€ã ã¢ãŠã: 45 å
ãµãŒãã¬ã¹é¢æ°ïŒServerless FunctionsïŒã¯ããã°ã©ãã³ã°èšèªãåäœãããæ©èœã§ã
HTMLã»ç»åãã¡ã€ã«ãªã©ãéçãã¡ã€ã«ã®è¡šç€ºã§ã¯ãµãŒãã¬ã¹é¢æ°ã®å¶éã¯å¯Ÿè±¡å€ã§ãã
æ°ã¶æããã§ãã©ã³ã®å€åãçããŠããŸãããã
2021幎ã§èšå®ããããã©ã³ã§ 1 幎以äžèœã¡çããŠããŸãã
ä»åŸãäžèšã®å¶éã¯å€ããå¯èœæ§ããããŸããã
åºæ¬çã«ã¯ç¡æãã©ã³ã§ãé垞䜿çšã§åé¡ããªãç¯å²ã§ã
ã ãã ããšå¶éã¯ãããããŠããããã«æãããŸãã
ãã°ã€ã³ã»ã¢ã«ãŠã³ãæ¹æ¶
Vercel ã§ã¯ãã¹ã¯ãŒããææããŸããã
ãã°ã€ã³ã¯ã¡ãŒã«èªèšŒãŸã㯠GitHubã»GitLabã»Bitbucket çµç±ã§ãã°ã€ã³ããŸãã
ã¢ã«ãŠã³ãã®æ¹æ¶ã¯ Settings - General å
Delete Your Vercel Account ã§å®¹æã«ã§ããŸããã
äžåºŠã¢ã«ãŠã³ããæ¹æ¶ãããšãã®ã¡ãŒã«ã¢ãã¬ã¹ã§ã¯åç»é²ã§ããªããªããŸãã
ãã°ãã䜿ãäºå®ããªããŠãå°æ¥ç䜿ãäºå®ãããã°ã¢ã«ãŠã³ãæ¹æ¶ããªãã§äžããã
Git é£æº
Git ãªããžããªãšé£åããäºã§ CLI ã䜿çšããäºãªãã
ãªããžããªãžã® push ã«ããããã«ãã»ãããã€ãããããã«ãªããŸãã
â² Git | Vercel Documentation
次㮠Git ãªããžããªã«å¯Ÿå¿ããŠããŸãã
- Â GitHub
- Â GitLab
- Â Bitbucket
åœåã¯ãŠãŒã¶ãŒããã³ããŒã å¥ã« GitHubã»GitLabã»Bitbucket ã®é¢é£ä»ããè¡ã£ãŠããŸãããã
2020幎12æããããããžã§ã¯ãå¥ã§ãªããžããªã®é¢é£ä»ããå¯èœã«ãªããŸããã
ãããžã§ã¯ããéžæãã Project Settings ã« Git ã®é
ç®ãå¢ããŠããŸãã
Vercel CLI ã€ã³ã¹ããŒã«
Git é£æºãã䜿çšããªãå Žåã§ã Vercel CLI ãå ¥ããŠãããšäŸ¿å©ãããããŸããã
Node.js ãã€ã³ã¹ããŒã«ããç¶æ
ã§ã
ã·ã§ã«ã»ã¿ãŒããã«ãã次ã®ã³ãã³ãã§ã€ã³ã¹ããŒã«ã§ããŸãã
npm i -g vercel
ããŒãžã§ã³ã¢ãããåãæ¹æ³ã§ãã
æŽæ°ãæ¿ããã®ã§ãåäœããããããšæã£ããæŽæ°ããŠã¿ãŠäžããã
â² Download Vercel CLI | Vercel
ç¬èªãã¡ã€ã³ã»ãµããã¡ã€ã³.vercel.app
ç¬èªãã¡ã€ã³ã賌å
¥ããŠäœ¿çšã§ããŸãã
.jp ãªã©ç»é²æ¡ä»¶ãããç¬èªãã¡ã€ã³ã¯ããããç»é²ã§ããŸããã
ãã¡ã€ã³ã Vercel ã§è³Œå
¥ããåŸã«ä»ã® Web ãµãŒãã¹ãžç§»ãå¿
èŠãããå Žåã
Web ãµã€ãã® Domain ãã該åœãã¡ã€ã³åã®å³ã«ãã ïž - Transfer Out ã§
Auth Code ãå
¥æãã容æã«ç§»ç®¡ãå¯èœã«ãªã£ãŠããŸãã
ãã ãç¬èªãã¡ã€ã³ã®å€ãã¯æ°èŠç»é²ãã 60 æ¥ã¯ç§»ç®¡ã§ããªãã®ã§ã泚æäžããã
ãã§ã«ææããŠãããã¡ã€ã³ã¯ Web ã® Domain ããè¿œå ããéã
èšå®ããããŒã ãµãŒãã衚瀺ãããŸãã
ãµããã¡ã€ã³ãªãã®å Žå㯠A
ã¬ã³ãŒãã®èšå®ã衚瀺ãããŸãã
ãµããã¡ã€ã³ | çš®é¡ | å€ |
---|---|---|
@ã»ç©ºçœã»ãã¡ã€ã³å | A | 76.76.21.21 |
ãµããã¡ã€ã³ãä»ããŠããå Žå㯠CNAME ã¬ã³ãŒãã«ãªããŸããwww
ãå«ã¿ãŸãã
ãµããã¡ã€ã³ | çš®é¡ | å€ |
---|---|---|
èšå®ãµããã¡ã€ã³ | CNAME | cname.vercel-dns.com. |
ãµããã¡ã€ã³ã¯ã¯ã€ã«ãã«ãŒãæå®ãå¯èœã§ãã
â² Introducing Wildcard Domains | Vercel Blog
è¿œå ã®ä»£ããã« Transfer-In ãéžæããVercel ã§ãã¡ã€ã³ç®¡çããäºãã§ããŸãã
ãã¡ã€ã³ã ð Cloudflare ã§ç®¡çããŠããå Žåã
Vercel ã¯ãããèªèããŠæ³šææžãã衚瀺ããŸãã
ãµããã¡ã€ã³ãªãã®å ŽåãA ã¬ã³ãŒã㧠IP ã¢ãã¬ã¹ãèšå®ããããã«è¡šç€ºãããŸãã
ããŒã ãµãŒããèšå®ããŠããã¡ã€ã³ããŸãããš Vercel 管çãããäºãã§ããŸãã
2020幎5æããããŒã ãµãŒããå€æŽãããŠããŸããåŸæ¥ã¯ãã¡ããæšå¥šã§ããã
ããŒã ãµãŒã |
---|
ns1.vercel-dns.com |
ns2.vercel-dns.com |
ãã¡ã€ã³ãããŒã ãµãŒãã§ç»é²ããå ŽåãããŒã ãµãŒãã®ã¬ã³ãŒãèšå®ãè¡ããŸãã
ããã«ãããVercel 管çã«ããŠããµããã¡ã€ã³ãªã©ã¯å€éšãµãŒãã¹ã䜿çšã§ããŸãã
以å㯠Vercel CLI ã®ã¿èšå®å¯èœã«ãªã£ãŠããŸãããã
çŸåšã¯ Vercel ã® Web ãã Domains ããã¬ã³ãŒãèšå®ãå¯èœã§ãã
代ããã« ãµããã¡ã€ã³.vercel.app ã䜿çšããäºãã§ããŸãã
â² Custom Domains | Vercel Docs
ãã¡ã€ã³ã»ãµããã¡ã€ã³æ¯ã®ãªãã€ã¬ã¯ã
2019幎10æãããWeb äžã§ããã¡ã€ã³ã»ãµããã¡ã€ã³æ¯ã®ãªãã€ã¬ã¯ãã
容æã«èšå®ã§ããããã«ãªããŸããããµããã¡ã€ã³.vercel.app
ããªãã€ã¬ã¯ãã®èšå®ãå¯èœã§ãã
ç¬èªãã¡ã€ã³ã§ã®å
¬éã«ããå Žåã¯ãªãã€ã¬ã¯ãèšå®ãããšã
Web ã Vercel CLI ã§ãç¬èªãã¡ã€ã³ã®ã¢ãã¬ã¹ãã¡ã€ã³è¡šç€ºãããŸãã
â² Redirecting Domains | Vercel Blog
ãµããã¡ã€ã³ã®ã¬ã³ãŒãèšå®
ç¬èªãã¡ã€ã³ã®ããŒã ãµãŒãã Vercel ã«èšå®ããå Žåã
Vercel CLI ãããµããã¡ã€ã³ã®ã¬ã³ãŒããèšå®ã§ããŸãã
Git é£æºã«ããŠããå Žåã§ã䜿çšå¯èœã§ãã
â² dns | Vercel CLI Reference
2020幎6æãããWeb ã® Dashboard ç»é¢ãããDpmains ãéžæãã
該åœãã¡ã€ã³ã® ïž - View DNS Records & More ãéžæããäºã§
ã¬ã³ãŒãã®ç¢ºèªã»èšå®ã Web ããã§ãè¡ããããã«ãªããŸããã
ãã¡ã€ã³ããããžã§ã¯ãã«å²ãåœãŠãŠããå Žåã¯ããããžã§ã¯ãã® View Domains ã§
該åœãã¡ã€ã³ã® Edit ãéžæã View DNS Records & More for ãã¡ã€ã³å ã§ã
ã¬ã³ãŒã確èªã»èšå®ãè¡ãäºãã§ããŸãã
â² DNS Records UI | Vercel Blog
ããŒã ãµãŒãã®ã¬ã³ãŒãèšå®ã«ã€ããŠã¯ã次ãåç §ããŠäžããã
ð ããŒã ãµãŒã | ãµãããð FU-SEN
ã¬ã³ãŒãã®è¿œå - Aã»AAAAã»ALIASã»CNAME
ã¬ã³ãŒãã®è¿œå ã¯é垞次ã«ãªããŸãã
ããŒã ãµãŒãåŽã§å€ã®å
ãåç
§ããAã»AAAA ã¬ã³ãŒãã§è¿ã ALIAS
ã䜿çšã§ããŸãã
vercel dns add ãã¡ã€ã³å ãµããã¡ã€ã³ çš®é¡ å€
ãµããã¡ã€ã³ããªãå Žå㯠'@'
ãšããŸãã @
ã®ã¿ã¯ç°å¢ã«ãããšã©ãŒãšãªããŸããALIAS
ã¯éåžžãµããã¡ã€ã³ããªã '@'
ã§äœ¿çšããŸãã
ã¬ã³ãŒãã®è¿œå - TXT
TXT
ã¬ã³ãŒã㯠SPF ã®èšå®ããã¡ã€ã³ææè
èªèšŒãªã©ã§äœ¿ãããŸãã
vercel dns add ãã¡ã€ã³å ãµããã¡ã€ã³ TXT 'å€'
空çœãå«ãŸããå Žåã¯å¿
ãå²ã£ãŠäžããã 'å€'
ã®ä»£ããã« "å€"
ã§ãæ§ããŸããã
ã¬ã³ãŒãã®è¿œå - MX
vercel dns add ãã¡ã€ã³å ãµããã¡ã€ã³ MX å€ åªå
床
å°èŠæš¡ã§ããã°ãã¡ãŒã«ã¢ãã¬ã¹ã¯ address@domain.ext
ãªã®ã§ããµããã¡ã€ã³
㯠'@'
ã«ãªãã§ãããã
ã¬ã³ãŒãã®è¿œå - SRV
vercel dns add ãã¡ã€ã³å ãµããã¡ã€ã³ SRV åªå
床 Weight ããŒã ãã¹ãå
ã¬ã³ãŒãã®è¿œå - CAA
Vercel 㯠ð Let’s Encrypt ãçºè¡ãã
ãã®éã« CAA ã¬ã³ãŒããèšå®ããŸãã
ç¬èªã«èšŒææžãã¢ããããŒãããæã¯èšå®ãããäºãã§ããŸãã
vercel dns add ãã¡ã€ã³å ãµããã¡ã€ã³ CAA 'ãã©ã° ã¿ã° "ãã¹ãå"'
'ïœ'
ã®å²ãã«ã泚æäžããã
ã¬ã³ãŒãã®äžèŠ§
vercel dns ls ãã¡ã€ã³å
ãã¡ã€ã³å
ãçç¥ããæã¯ãã°ã€ã³ããŠããã¢ã«ãŠã³ããã¹ãŠã®å€ã衚瀺ãããŸããvercel dns add ïœ
ã§è¿œå ããã¬ã³ãŒã㯠id
ã«å€ããããŸãã
ãã㯠vercel dns rm ïœ
ã§äœ¿çšããŸãã
ã¬ã³ãŒãã®åé€
vercel dns rm ã¬ã³ãŒãID
ã¬ã³ãŒãID
㯠vercel dns ls ãã¡ã€ã³å
ã§è¡šç€ºãããŠããŸãã
ãŸãŒã³ãã¡ã€ã«ã®ã€ã³ããŒã
ä»ã§éçšããŠããããŒã ãµãŒãã®ãŸãŒã³ãã¡ã€ã«ãããå Žåã
ã€ã³ããŒãã§äžæ¬èšå®ãå¯èœã§ãã
vercel dns import ãã¡ã€ã³å ãŸãŒã³ãã¡ã€ã«
åäœç¢ºèª
vercel dev
ã§ãããŒã«ã«äžã§ã®åäœç¢ºèªãè¡ããŸãã
ãããžã§ã¯ããã£ã¬ã¯ããªãžç§»åããŸãã
cd ãããžã§ã¯ããã£ã¬ã¯ããª
vercel dev
Vercel ã¯ã¢ããªã®ãã«ãã«å¯Ÿå¿ããŠããŸãã
 ããã°ã©ãã³ã°èšèªã®å®è¡ïŒServerless FunctionsïŒ
ãµã€ãã®å ¬éïŒãããã€ïŒ
ãµã€ãã®å ¬éåäœããããã€ãšãªããŸãã
Vercel CLI
ç°¡åãªäœ¿ãæ¹ã¯ãããžã§ã¯ããã£ã¬ã¯ããªã«ç§»åããvercel --prod
ãå®è¡ããŸãã
cd ãããžã§ã¯ããã£ã¬ã¯ããª
vercel --prod
Vercel CLIïŒNow CLIïŒ17.0 以éã§ãããžã§ã¯ããã¯ãããŠãããã€ããå Žåã
察話åŒã§èšå®ãè¡ããŸãã
> vercel --prod
Vercel CLI 18.0.0
? Set up and deploy âãã£ã¬ã¯ããªâ? [Y/n] ãããã° Y
? Which scope do you want to deploy to? ãŠãŒã¶ãŒå
? Link to existing project? [y/N] ãã§ã«ãããžã§ã¯ããããã° Y æ°èŠã¯ N
? Whatâs your projectâs name? ãããžã§ã¯ãåãå
¥å
? In which directory is your code located? ãã«ãããå ŽæïŒããã©ã«ãã,/ïŒ
ãã¬ãŒã ã¯ãŒã¯å framework detected. Default project settings:
- Build Command: `npm run now-build` or `npm run build`
- Output Directory: `public` if it exists, or `.`
- Development Command: None ãããŸã§è©²åœãããã¬ãŒã ã¯ãŒã¯ããªãå Žå
? Want to override the settings? [y/N] äžã®èšå®ã§æ£ãããã° N å€æŽã¯ Y
ï¿œ Linked to ãŠãŒã¶ãŒ/ãããžã§ã¯ã (created .now and added it to .gitignore)
ï¿œ Inspect: URL [ãã«ãæé]
â Production: URL [copied to clipboard] [ãã«ãæé]
Web ããèšå®ã®å€æŽãå¯èœã§ãã
äžåºŠèšå®ããåŸã¯ã·ã³ãã«ãªè¡šç€ºã«ãªããŸãã
> vercel --prod
Vercel CLI 18.0.0
ï¿œ Inspect: URL [ãã«ãæé]
â Production: URL [copied to clipboard] [ãã«ãæé]
ããŒã«ã«ã§ãã«ãããŠãå
¬éããäºãã§ããŸãã
Hugo ã¯éåžž public/ ãã£ã¬ã¯ããªå
ã« index.html ãªã©ãçæããŸãã
hugo
vercel --prod public
ãã ã Vercel 㯠Hugo ã®èªåãã«ãã«å¯Ÿå¿ããŠããŸãã
ãããã£ãŠã hugo
ã³ãã³ããå®è¡ããäºãªãã
Hugo æ§æãã£ã¬ã¯ããªã§ vercel --prod
ãšããŠæ§ããŸããã
Hugo ãèªèããèªåãã«ãããŸãã
ãã¡ãããã§ã« index.html ããããšãã㧠vercel --prod
ãå¯èœã§ãã
--prod
ãä»ããªã vercel
ã®å Žåã¯ããµããã¡ã€ã³.ãŠãŒã¶ãŒ.vercel.app
ã§ä»®å
¬éã§ããã¢ãã¬ã¹ã§çæãããŸãã
ããããšã¯å¥ã«çææ¯ã«ã©ã³ãã ã«ä»å ãããã¢ãã¬ã¹ã§ãçæãããŠããŸãã
å¿
èŠãªå Žå㯠Web ããããŒã«ããã¯ããäºãå¯èœã§ãã
Git é£æº
git push
ãããšãã«ããè¡ãããŸãã
GitHub ã§ã¯ commit ã«ã³ã¡ã³ããå
¥ããã¡ãŒã«éç¥ãè¡ãããŸãã
Vercel CLI åæ§ãHugo ãªã©ãèªåèªèããŠãã«ãããŠãããŸãã
ãµãŒãåŽã§ã®ãã£ãã·ã¥
Vercel ã¯éçãã¡ã€ã«ã®å Žåããã£ãã·ã¥ãµãŒãïŒãšããžãµãŒãïŒã«ãã£ãã·ã¥ãã
å床åç
§ããæã¯æŽæ°ã確èªããäžã§ãã£ãã·ã¥ãµãŒãããé
ä¿¡ããŸãã
æ¥æ¬ã®å Žåã¯æ±äº¬ã«ãµãŒããããããšãŠãã¬ã¹ãã³ã¹ãéãã
æŽæ°ããã£ãå Žåã¯ææ°ã®ãã¡ã€ã«ãåºåãããä»æ§ã«ãªã£ãŠããŸãã
æå³çã«ãã£ãã·ã¥ãç¡å¹ã«ããããéã« ããã°ã©ãã³ã°èšèªã®å®è¡ ã§ãæå¹ã«ã§ããŸãã
hTTP ãããã® Cache-Control
ã¯ããã©ã«ãã§æ¬¡ã«ãªã£ãŠããŸãã
Cache-Control: public, max-age=0, must-revalidate
åŸã£ãŠ Web ãã©ãŠã¶ã«ãã£ãã·ã¥ãä¿åããã
å¿
ã Vercel ãµãŒããåç
§ããåæã«ãªã£ãŠããŸãã
ãã㯠ð Cloudflare ãªã©ã® CDN ãµãŒãã¹ãæŽã«çµç±ãããŠã
ãã®ãŸãŸã§ã¯å¹æããªãäºãæå³ããŸãã
転ééãªã©ç¹å¥ãªçç±ããªãéãããã¡ã€ã³ã Cloudflare ãžãµã€ãç»é²ããŠãã£ãŠãã
ãDNS onlyãã«ããŠä»ã®æ©èœã¯ç¡å¹ã«ãã
å®å
šã« Vercel ä»»ãã§å¶åŸ¡ããŠããŸãã®ãç¡é£ã§ãããã
HTTP ãããã« X-Vercel-Cache
ãå«ãŸããŠããŸãã
ããã§ãã£ãã·ã¥ã®ç¶æ³ãææ¡ã§ããŸãã
X-Vercel-Cache | ãã¡ã€ã«æäŸ | æå³ |
---|---|---|
MISS | é ä¿¡ãµãŒã | ãšããžãµãŒãã«ãã¡ã€ã«ãªã |
HIT | ãšããžãµãŒã | ãšããžãµãŒãã«ãã¡ã€ã«ãã |
BYPASS | é ä¿¡ãµãŒã | ãšããžãµãŒããééãã |
STALE | é ä¿¡ãµãŒã | ãšããžãµãŒãã®ãã¡ã€ã«ã¯æéåã |
REVALIDATED | ãšããžãµãŒã | ãšããžãµãŒãã®ãã¡ã€ã«ã¯æéåãã§åæ€èšŒ |
ããã°ã©ãã³ã°èšèªã®å®è¡ïŒServerless FunctionsïŒ
â² Supported Languages | Vercel Docs
次ã®ããã°ã©ãã³ã°èšèªã¯ api/
å
ã«ãœãŒã¹ãå
¥ããŠå®¹æã«å®è¡ã§ããŸãã
æ¡åŒµåã§å®è¡ããèšèªãéžå®ãããŸãã次ã®ãšããã§ãã
- Node.js (.js ããã³ .tsïŒ
- GoïŒ.goïŒ
- PythonïŒ.pyïŒ
- RubyïŒ.rbïŒ
api/
ãä»ããã«åäœããããå Žåãæ¡åŒµåã«é¢ä¿ãªãåäœããããå Žåã¯vercel.json
㧠routes
ãªã©ãèšå®ããŸãã
{
"rewrites": [
{ "source": "/(.*)", "destination": "/api/file.js" }
]
}
â² Community Runtimes | Vercel Docs - Official Runtimes
Community Runtimes ãšããŠæ¬¡ã®èšèªã察å¿ãããŠããŸãã
.php
ãã¡ã€ã«ã®å Žåã« PHP ãåäœããããã«ããäŸã§ãã
{
"functions": {
"api/*.php": {
"runtime": "vercel-php@0.4.0"
}
}
}
éçãã¡ã€ã«ã®åºåã¯äžçäžã® CDN ãµãŒããžé
ä¿¡ãããŸããã
åçã«åäœããå Žåãç¡æãã©ã³ã§ã¯ 1 ã¶æã®ã¿ã§ããvercel.json
ã§å Žæãæå®ã§ããŸãã®ã§ã
æ¥æ¬åãã§ã§ããã° hnd1
ã§æ±äº¬ãµãŒãã«ãããšè¯ãã§ãããã
{
"regions": ["hnd1"]
}
åçãã¡ã€ã«ã®ãã«ããè¡ãå Žåã
ç¡æãã©ã³ã§ã¯ãã«ããäžåºŠè¡ããšæ¬¡ã®ãã«ããè¡ãããŸã§æ°ååŸ
ããããŸãã
vercel dev
ã§ããŒã«ã«ã«ããåäœç¢ºèªãå¯èœã§ããã
䜿çšããèšèªãã€ã³ã¹ããŒã«ãããŠããå¿
èŠããããŸãã
ããã°ã©ãã³ã°èšèªãçšãããã«ã
ⲠBuild Step  Build Image | Vercel Docs
Vercel ãžã¢ããããŒãããåŸã
ããã°ã©ãã³ã°èšèªãçšããŠãã«ãäœæ¥ãè¡ãããå Žåã¯
Build Step ãçšããŠä»»æã®ããã°ã©ãã³ã°èšèªãã€ã³ã¹ããŒã«ãã
ãã«ãäœæ¥ãè¡ãäºãã§ããŸãã
vercel.json
ã«ã¬ã³ããã£ã¬ã¯ããªã® vercel.json ã§åäœãèšå®ã§ããŸãã
æ§è¡šèšã¯ now.json
ã§ããã¡ããæå¹ã§ãããåŸã«äœ¿ããªããªãå¯èœæ§ããããŸãã
JSON ãªã®ã§ã ,
åºåãã§é
ç®ã䞊ã¹ãŸãããã®ãããªæãã«ãªããŸãã
{
"regions": ["hnd1"],
"functions": {
"api/*.php": {
"runtime": "vercel-php@0.4.0"
}
},
"rewrites": [
{ "source": "/(.*)", "destination": "/api/$1" }
]
}
äžã®é ç®ä»¥å€ã«ãããã€ãååšããŸãã
- envã»build.env ç°å¢å€æ°ã®èšå®
- regions å®è¡ãããã±ãŒã·ã§ã³ïŒæ±äº¬ã¯
"hnd1"
ïŒ - redirects 転éïŒãããã 301ã»302 転éã®èšå®ïŒ
- rewrites rewrite èšå®
- headers HTTP ãããã®ä»å
rewrites
ã® destination
㯠URL è¡šèšãå¯èœã§ã
ããã«ããããªããŒã¹ãããã·ã容æã«å®çŸå¯èœã§ãã
åœå㯠routes
ã䜿ãããŠããŸããããçŸåšã¯éæšå¥šã«ãªããŸããã
redirectã»rewritesã»header ã䜿çšããŠäžããã
ãŸãããããžã§ã¯ãåãèšå®ãã name
ã
å
¬éãã¡ã€ã³åãèšå®ãã alias
ãçŸåšéæšå¥šã«ãªã£ãŠããŸãã
â² Configuration Reference | Vercel Docs
以å㯠vercel.json
ã®çæãå¿
é ã§ããããçŸåšã¯ãªãã§ããããã€ã§ããŸãã
Vercel CLI ã䜿çšããå Žåã.vercel
ãã£ã¬ã¯ããªå
ã«é¢é£ãã¡ã€ã«ãçæãããŸãã
ãã¡ã€ã« .gitignore
ãçæãããGit ãªããžããªã§ã¯ .vercel
å
ã察象å€ã«ãªããŸãã
ãããã¯æ§ç§°ã§ã¯ now.json
ããã³ .now
ãã£ã¬ã¯ããªã§ãããã
åŸã«äœ¿ããªããªãå¯èœæ§ããããããå€æŽãããããããŸãã
Q&A
Vercel ã®ãµãŒãã¯ã©ãã«ããã®ã§ããïŒ
äžçåå°ã«èšçœ®ããŠããŠãæ¥æ¬ã«ã¯æ±äº¬ã«ãµãŒãããããŸãã
â² Regions | Vercel Documentation\
éçãã¡ã€ã«ã¯è¿å Žã«ããïŒæ¥æ¬ãªãã°æ±äº¬ïŒ
ãšããžãµãŒãã«ãã¡ã€ã«ããã£ãã·ã¥ãšããŠèãã
äžå®æéã§åããªã¯ãšã¹ãããã£ãå Žåã¯ãã£ãã·ã¥ããå¿çããŸãã
ãã®ãããç¹ã«éçãã¡ã€ã«ã¯çŽ æ©ãã¬ã¹ãã³ã¹ãå®çŸããŠããŸãã
åçãã¡ã€ã«ã§ã Cache-Control
ãããã®ä»äžã«ãã£ãŠãã£ãã·ã¥ãæå¹ã«ã§ããŸãã
ããã°ã©ãã³ã°èšèªã®å®è¡ïŒServerless FunctionsïŒ
SSL ã¯æå¹ã§ããïŒ
ã¯ããå
¬éã¢ãã¬ã¹ã¯å¿
ã SSL ãæå¹ã«ãªããŸãã
SSL ãªãã§ã¯äœ¿çšã§ããŸããã.vercel.app
ã§æ¡çšãããŠãã .app
ãã¡ã€ã³ã¯ Web ãµã€ãã https éå®ã§ãã
ç¬èªãã¡ã€ã³ãæå®ããå Žåã§ããhttp 㯠https ãžè»¢éããåžžæ SSL ã«ãªããŸãã
éåžž Vercel ã¯ç¡æã® SSL ãµãŒã蚌ææž Let’s Encrypt ãçºè¡ããŸãããµããã¡ã€ã³.vercel.app
ããã³ ãµããã¡ã€ã³.ãŠãŒã¶ãŒ.vercel.app
ã¯
å¿
ã Let’s Encrypt ãçšã㊠SSL åãããŸãã
â² Automatic SSL with Now and Let’s Encrypt | Vercel Blog
ð Let’s Encrypt | ãµãããð FU-SEN
ç¬èªãã¡ã€ã³ã®å Žåã Let’s Encrypt ãçºè¡ããã®ã§ãéåžžæèããå¿ èŠãããŸããã
Cloudflare ã䜿çšããç¬èªãã¡ã€ã³ã§åç §ã§ããŸããã
â² How do I use a Cloudflare domain with Vercel? | Vercel Blog
â² Provider Specific Instructions Cloudflare | Vercel Docs
ð Cloudflare | ãµãããð FU-SEN
Cloudflare ãæå¹ã«ãããŸãŸ Vercel åŽã§è¿œå ãããšã
Let’s Encrypt ã®ãã¡ã€ã³èªèšŒã«å€±æããŸãã
ç¹ã« Cloudflare 管çã«ããå¿
èŠããªããã°ã
ð ããŒã ãµãŒã ã Vercel ã«å€æŽãããã
DNS ã®é
ç®ã§ DNS only ã«ããŠãCloudflare ãããŒã ãµãŒã管çã®ã¿ã«ããŸãã
Cloudflare ã® CDN ãªã©ã䜿çšãããå Žåã¯ã
Let’s Encrypt ãçæãããã£ã¬ã¯ããªã SSL ã®å¯Ÿè±¡ããå€ããŠäžããã
Cloudflare ãã 察象ãã¡ã€ã³ ãã
SSL/TLS - ãšããžèšŒææžã»Edge Certificates ãéžæãã
ãåžžã« HTTPS ã䜿çšã»Always Use HTTPSãã ãªãã»Off ã«ããŸãã
ãã®é
ç®ã ã㯠ããŒãžã«ãŒã«ã»Page Rule ã§ãªãã«èšå®ã§ããŸããã
ãµããã¡ã€ã³ãä»ã® Web ãµãŒãã¹ã§äœ¿çšããŠããå Žåã
httpâhttps 転éã¯å¥ã®æ¹æ³ã§å¯ŸåŠããå¿
èŠããããŸãã
æŽã« ããŒãžã«ãŒã«ã»Page Rules ãçšããŠæ¬¡ãèšå®ããŸãã
察象ãã¡ã€ã³ã example.net
ã®å Žåã次ã®èšå®ãšãªããŸãã
example.net/.well-known/*
- SSL - ãªãã»Off
æ£ããèšå®ãããŠããããcurl
ãçšããŠç¢ºèªããŠäžããã
PS C:\Users\balloon> curl.exe http://example.net/.well-known/acme-challenge -I
HTTP/1.1 404 Not Found
äžèšã®ããã« 404 Not Found
ãè¿ã£ãŠããã°æ£åžžã§ãã301
ã 302
ãè¿ã£ãŠããå Žåã¯ãèšå®ãããããã®ã§ç¢ºèªããŠäžããã
ãªããçŸåš Vercel ãã®ãã®ã CDN ã§ãšããžãµãŒããæ§ããŠããŠã
æ¥æ¬ããïŒç¹ã« Cloudflare ã§æ±äº¬ã®ãµãŒããåç
§ããåæ¥æ¬ïœæ±æ¥æ¬ïŒã®
ã¬ã¹ãã³ã¹ã¯ Cloudflare ã®ãšããžãµãŒããšã»ãŒå€ãããªãéãã«ãªããŸããã
éçãã¡ã€ã«ã§ã¯ãããããã©ã«ãã§é©çšãããããã«ãªããvercel --prod
ã§ã¯ãã£ãã·ã¥ã¯ãªã¢ãããææ°ãã¡ã€ã«ã貯ããªãããŸãã
CDN ã䜿çšããŠããäºãæèããã«äœ¿ããŠãã¬ã¹ãã³ã¹ãè¯ãããšãŠãçæ³çã§ãã
転ééããšãŠãå€ããªã©ãç¹å¥ãªçç±ããªãéãã¯ãCloudflare çµç±ã«ããã
Vercel ãçŽæ¥åç
§ããããã«èšå®ããäºãããããããŸãã
æ¥æ¬èªãã¡ã€ã³ã¯äœ¿çšã§ããŸããïŒ
PunycodeïŒxn--
ã§ã¯ããŸãè±æ°ïŒã§ç»é²ããŠäœ¿çšã§ããŸãããµããã¡ã€ã³.vercel.app
ãæ¥æ¬èªã§èšå®ã§ããŸãã
ãã ããããžã§ã¯ãåã§ã¯ --
ã -
ã«å€æãããPunycode ã¯äœ¿çšã§ããŸããã
Not Found ã®è¡šç€ºãç¬èªã®èšå®ã§ããŸããïŒ
â² Custom 404 Page | Vercel Blog
éçãã¡ã€ã«ã®å Žåã404.html ãçæããŠæ©èœããŸãã
äžææ©èœããªãäºããã£ãããvercel.json
ã§ã®æå®ãå¿
èŠãªäºããããŸãããã
çŸåšã¯ç¹ã«èæ
®ããã«æ©èœããŸãã
éçãµã€ããžã§ããŒã¿ã¯ 404.html
ãçæããäºãå€ããæåŸ
ãã衚瀺ãã§ããŸãã
åçãã¡ã€ã«ã® /api/
å
ã§æ©èœããããå Žåã404.html
以å€ã®ãã¡ã€ã«ã䜿çšãããå Žåãæ段ããããŸãã
ãã ã vercel.json
ã® routes
ã¯çŸåšéæšå¥šã®èšå®ãšãªã£ãŠããŸãã
HTTP ããããŒãèšå®ã§ããŸããïŒ
Web ãã©ã³ããªã©ã®éçãã¡ã€ã«ã§äœ¿çšããå Žåã¯ãvercel.json
ã« routes
ã headers
ã§èšå®ããäºã«ãªããŸããã
Vercel ã§ã¯éçãã¡ã€ã«ã®å Žåãããã©ã«ã㧠access-control-allow-origin: *
ãè¿ããŸãã
ãã®ãããéåžžã¯ç¹ã«èšå®ããã«æåŸ
ããåç
§ãåŸãäºãã§ããŸãã
ãŸãéåžžãã£ãã·ã¥ã¯ 31 æ¥éæå¹ã§ãã
api/
å
ã§ããã°ã©ãã³ã°èšèªïŒServerless FunctionsïŒãå®è¡ããå Žåã¯vercel.json
ãããã°ã©ãã³ã°èšèªã§ããããŒãå ããŠäžããã
ãµããã¡ã€ã³.vercel.app 㯠Google ã®æ€çŽ¢çµæã«è¡šç€ºãããŸããïŒ
site:vercel.app æ€çŽ¢çµæ | Google
vercel --prod
ã§å
¬é URL ãšããŠå
¬éããŠãã ãµããã¡ã€ã³.vercel.app
ã¯ã
Google ãªã©ã§æ€çŽ¢çµæã«åºãŠãã察象ã§ãã
ç¡æã§èª°ã§ã䜿çšã§ãããã¡ã€ã³ãªã®ã§ãåŸã«æªçšãããå¯èœæ§ãããã
ãŸãšããªéå¶ã¯ç¬èªãã¡ã€ã³ã®äœ¿çšãæšå¥šãããŠããŸãã
ããã§ã¯ãªãéçºåã URL ãããžã§ã¯ã-ä»»æã®è±æ°-ãŠãŒã¶ãŒ.vercel.app
ã
ãããžã§ã¯ã-ãŠãŒã¶ãŒ.vercel.app
ã§ã¯
HTTP ãããã« x-robots-tag: noindex
ãå«ãŸããŠããããã
ã¯ããŒã©ãŒïŒæ€çŽ¢ãšã³ãžã³ããããïŒã¯ãããæ€çŽ¢çµæã«å
¥ããäºã¯ãããŸããã
ãã®ããäžè¬å
¬éããããªãå Žå㯠robots.txt
ã meta ã¿ã°ã§æåŠããã代ããã«--prod
ãä»ããªã vercel
ã³ãã³ãã§éçº URL ãçæã䜿çšããäºãå¯èœã§ãã
è€æ°ã®ã¢ãã¬ã¹ã§å ¬éãããŠããŸãã®ã§ããâŠâŠ
â² Deployments Deployment Types | Vercel Docs
æ¯åçæããã URLããïœãŸã€ã§ã¯ã-ä»»æã®è±æ°-ãŠãŒã¶ãŒ.vercel.app
ã
ã³ãã³ã vercel
ã§çæããã ãããžã§ã¯ã-ãŠãŒã¶ãŒ.vercel.app
ã¯
HTTP ãããã« X-Robots-Tag: noindex
ãä»äžããŸãã
ãã®ãããGoogle ãªã©ã®åé察象ã«ãªããŸãããvercel --prod
ã§ããããå«ããè€æ°ã® URL ãå
¬éããŸããããµããã¡ã€ã³.vercel.app
ãŸãã¯èšå®ããŠããç¬èªãã¡ã€ã³ã®
å
¬éçš URL ã®ã¿ãæ€çŽ¢çµæã®å¯Ÿè±¡ãšãªããŸãã
ããããå
¬éçš URL ãè€æ°æå®ããŠããå Žåã¯ã
ãã¹ãŠ Google ãªã©ã§åéãããäºã«ãªã£ãŠããŸããŸãã
é©å㪠URL ã§è¡šç€ºãããããã«ããã«ã¯<link rel="canonical">
ãçšããŠæ€çŽ¢çµæã«åºãŠããŠã»ããã¢ãã¬ã¹ãæå®ããŸãã
<link rel="canonical" href="https://balloon.asia/vercel/">
éçãµã€ããžã§ããŒã¿ã§ã¯ããŒãã察å¿ããŠããäºãå€ãã®ã§ã
æ£ããçæãããŠããäºã確èªã§ããã°ãããšã¯èæ
®ããå¿
èŠãããŸããã
åçã«åºåããŠããå Žåã¯å¿
èŠã«å¿ããŠé©åãªè»¢éããããšã©ãŒè¡šç€ºã«ãããªã©
ãœãŒã¹åŽã§å¯ŸåŠã§ããã¯ãã§ãã
ç¬èªãã¡ã€ã³ã䜿çšã ãããžã§ã¯ã.vercel.app
ãªã©ã䜿ããããªãå Žåã
Vercel Web ãµã€ãã®ãã¡ã€ã³èšå®ã§è»¢éã®èšå®ãã§ããŸãã®ã§ã
301ã»308 転éã§ç®çã® URL ãåç
§ããããã«èšå®ããŠäžããã
äžå ·åã質åã¯ã©ãããã°è¯ãã§ããïŒ
Vercel CLI ãªã© GitHub ã«ãªããžããªãå
¬éãããŠããéšåã«ã€ããŠã¯
vercel/vercel ã® issues ã«å ±åããŠäžããã
 Issues - vercel/vercel | GitHub
質åã«ã€ããŠã¯ Discussions ã䜿çšã§ããŸãã
GitHub ãšããå Žæããããã£ãŠãè±èªã®æçš¿ã»ã³ã¡ã³ãã°ããã§ãã
ãŸãã Serverless Functions ãå®è£
ãããŠããã¯ã
éçºè
å¯ãã®çªã£èŸŒãã 質åãå€ããªã£ããããªæ°ãããŸãã
 Discussions - vercel/vercel | GitHub
ãŸããvercel.com å
ãåç
§ããŠããæã«å³äž Support ãã Vercel ã¡ã³ããŒã«é£çµ¡ã§ããŸãã
ãã®åŸã¯ã¡ãŒã«ã¢ãã¬ã¹ã§ã®ãããšãã«ãªããŸãã
Docs ã®æé¢ãã¹ãªã©ã¯å³äž feedback ããé£çµ¡ãå
¥ããã®ã䟿å©ã§ãã
å Žåã«ãã£ãŠã¯ã¡ã³ããŒããã¡ãŒã«ã§åå¿ãè¿ã£ãŠããŸãã
ãµãŒãã®åç §ãã§ããªãå Žåã¯ãVercel Status ãåç §ããŠã¿ãŠäžããã