Skip to content
This repository was archived by the owner on Jul 31, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.24.1
14.21.2
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodejs 14.21.2
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Firebase での Web アプリ作成については[公式リファレンス](htt
### 事前に必要なアプリケーション

- git
- Node.js 10
- Node.js 14
- Google Chrome

### Step 1: Firebase プロジェクトと freee アプリの作成
Expand Down Expand Up @@ -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 の設定

Expand Down Expand Up @@ -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"
Expand All @@ -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)にアクセスする。

## 本番環境のセットアップ

Expand Down Expand Up @@ -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
```

Expand Down
2 changes: 1 addition & 1 deletion functions/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.24.1
14.21.2
2 changes: 1 addition & 1 deletion hosting/.node-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.24.1
14.21.2
4 changes: 2 additions & 2 deletions hosting/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
2 changes: 1 addition & 1 deletion hosting/src/utils/path.ts
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"project-fmt": "npm run function-fmt && npm run hosting-fmt"
},
"engines": {
"node": "10"
"node": "14"
},
"devDependencies": {
"concurrently": "^4.0.1",
Expand Down