diff --git a/.node-version b/.node-version index dc08cc7..261767c 100644 --- a/.node-version +++ b/.node-version @@ -1 +1 @@ -10.24.1 +14.21.2 diff --git a/.tool-versions b/.tool-versions new file mode 100644 index 0000000..30139c5 --- /dev/null +++ b/.tool-versions @@ -0,0 +1 @@ +nodejs 14.21.2 diff --git a/README.md b/README.md index 9f1da73..85c7be9 100644 --- a/README.md +++ b/README.md @@ -58,7 +58,7 @@ Firebase での Web アプリ作成については[公式リファレンス](htt ### 事前に必要なアプリケーション - git -- Node.js 10 +- Node.js 14 - Google Chrome ### Step 1: Firebase プロジェクトと freee アプリの作成 @@ -101,7 +101,7 @@ Firebase での Web アプリ作成については[公式リファレンス](htt firebase use template-firebase-local ``` 1. freee アプリストアで freee アプリを作成する。( [こちら](https://developer.freee.co.jp/tutorials/starting-api)を参考にしながら freee アプリを作成してください。) - - コールバック URL は `http://localhost:5001/{{project-id}}/us-central1/api/auth/callback` にしてください。 + - コールバック URL は `http://localhost:5003/{{project-id}}/us-central1/api/auth/callback` にしてください。 ### Step 2: Firebase Cloud Functions の設定 @@ -145,8 +145,8 @@ Firebase Cloud Functions はサーバーレスで実行できる関数で、ロ ``` { "freee": { - "authHost": "http://localhost:5001/[Project ID]/us-central1/api/auth", - "appHost": "http://localhost:5000", + "authHost": "http://localhost:5003/[Project ID]/us-central1/api/auth", + "appHost": "http://localhost:5002", "homePath": "/select_company", "tokenHost": "https://accounts.secure.freee.co.jp", "apiHost": "https://api.freee.co.jp" @@ -168,22 +168,22 @@ Firebase Hosting は静的なファイル(HTML, JavaScript等)をデプロ hosting/.env.development に以下の設定を記載してください。 ``` # functions の URL - CLOUD_FUNCTION_HOST=http://localhost:5001/[Project ID]/us-central1 + CLOUD_FUNCTION_HOST=http://localhost:5003/[Project ID]/us-central1 # fucntionsのonCall呼び出しをローカルで動かす時に必要設定(CORSエラー対策) - CLOUD_FUNCTION_LOCAL_HOST=http://localhost:5001 + CLOUD_FUNCTION_LOCAL_HOST=http://localhost:5003 # hosting が接続する functions のリージョンを指定する HOSTING_REQUEST_FUNCTIONS_REGION=us-central1 - # 会計 freee のドメイン + # freee 会計のドメイン CFO_DOMAIN=https://secure.freee.co.jp ``` ### Step 4: アプリの起動 1. `npm run setup` を実行する。 -1. `npm start` を実行し、`http://localhost:5000` (hosting のURL)にアクセスする。 +1. `npm start` を実行し、`http://localhost:5002` (hosting のURL)にアクセスする。 ## 本番環境のセットアップ @@ -243,7 +243,7 @@ CLOUD_FUNCTION_HOST=https://asia-northeast1-[Project ID].cloudfunctions.net # hosting が接続する functions のリージョンを指定する HOSTING_REQUEST_FUNCTIONS_REGION=asia-northeast1 -# 会計 freee のドメイン +# freee 会計のドメイン CFO_DOMAIN=https://secure.freee.co.jp ``` diff --git a/functions/.node-version b/functions/.node-version index dc08cc7..261767c 100644 --- a/functions/.node-version +++ b/functions/.node-version @@ -1 +1 @@ -10.24.1 +14.21.2 diff --git a/hosting/.node-version b/hosting/.node-version index dc08cc7..261767c 100644 --- a/hosting/.node-version +++ b/hosting/.node-version @@ -1 +1 @@ -10.24.1 +14.21.2 diff --git a/hosting/package.json b/hosting/package.json index dd8d954..82e761a 100644 --- a/hosting/package.json +++ b/hosting/package.json @@ -1,12 +1,12 @@ { "scripts": { - "start": "firebase serve", + "start": "firebase serve --port 5002", "build": "NODE_ENV=production webpack --mode production", "watch": "NODE_ENV=development webpack --mode development -w", "fmt": "prettier --config '../.prettierrc' --write 'src/**/*.{tsx,ts}'" }, "engines": { - "node": "10" + "node": "14" }, "devDependencies": { "@types/axios": "^0.14.0", diff --git a/hosting/src/utils/path.ts b/hosting/src/utils/path.ts index 2ce8c57..9d4ebcb 100644 --- a/hosting/src/utils/path.ts +++ b/hosting/src/utils/path.ts @@ -1,4 +1,4 @@ -export const DEFAULT_LOCAL_FUNCTIONS_HOST = 'http://localhost:5001' +export const DEFAULT_LOCAL_FUNCTIONS_HOST = 'http://localhost:5003' export function getRedirectUrl() { const host = process.env.CLOUD_FUNCTION_HOST || getDefaultFunctionsHost() diff --git a/package.json b/package.json index ba7538e..958c9f9 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "project-fmt": "npm run function-fmt && npm run hosting-fmt" }, "engines": { - "node": "10" + "node": "14" }, "devDependencies": { "concurrently": "^4.0.1",