LoginSignup
0
1

More than 3 years have passed since last update.

Next.js 9のアップデートで環境構築が早くなって嬉しい

Last updated at Posted at 2019-07-17

Next.js 9に書かれている通り構築するのが早くなった。

TypeScriptをインストールして起動

Next.jsとReactをインストール

yarn react react-dom next

TypeScriptのパッケージをインストール

yarn add --dev typescript @types/react @types/node

Hello, World!を返すAPIサーバーを立てる

mkdir pages && cd pages
mkdir api && cd api
echo 'export default (res, req) => {req.send("Hello, World!")}' > index.js
yarn next dev

APIサーバーのHello Worldはこれだけで実行出来る
Image 154.jpg

0
1
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1