Upgrade to Pro — share decks privately, control downloads, hide ads and more …

next.jsを使ったuniversal React 入門

Sponsored · SiteGround - Reliable hosting with speed, security, and support you can count on. →
Hori Godai
December 14, 2018

next.jsを使ったuniversal React 入門

Hori Godai

December 14, 2018

Transcript

23 slides
  1. TypeScriptを利用 Babelのpresetを下記のように記述 .babelrc "presets": [ "next/babel", "@zeit/next-typescript/babel" ], next.config.js const

    withTypescript = require('@zeit/next-typescript') const withCSS = require('@zeit/next-css') module.exports = withTypescript(withCSS());
  2. netlifyの lambda function の利用 package.json "scripts": { "lambda": "netlify-lambda build

    functions", "lambda-local": "netlify-lambda serve functions", }
  3. netlifyの lambda function の利用 記述例 exports.handler = async (event, context,

    callback) => { return callback(null, { statusCode: 200, headers: { 'Content-type': 'application/json' }, body: JSON.stringify({ test: 'hoge' }) }); };

More Decks by Hori Godai

Other Decks in Programming