Skip to content
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
27 changes: 27 additions & 0 deletions .swm/client-build-steps.bhuhk.sw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
id: bhuhk
name: Client build steps
file_version: 1.0.2
app_version: 0.6.9-0
file_blobs:
frontend/src/config.json: adc77b7d0cdea411128f9ee321da43d4d4fa3c24
---

The URL is inserted during build time, so if you are building for product environment, change "http://localhost:9000" to "" before building.

Then, run the command "npm run build"

<br/>

<!-- NOTE-swimm-snippet: the lines below link your snippet to Swimm -->
### 📄 frontend/src/config.json
```json
⬜ 1 {
🟩 2 "SERVER_URL": "http://localhost:9000",
⬜ 3 "TITLE": "いつもの天気Jp"
⬜ 4 }
```

<br/>

This file was generated by Swimm. [Click here to view it in the app](https://app.swimm.io/repos/Z2l0aHViJTNBJTNBV2VhdGhlckRhdGFKcCUzQSUzQXJ5bzQ2MDA=/docs/bhuhk).
8 changes: 8 additions & 0 deletions .swm/deploy-client.syeu9.pl.sw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
id: syeu9
name: deploy client
file_version: 1.0.2
app_version: 0.6.9-0
---

This file was generated by Swimm. [Click here to view it in the app](https://app.swimm.io/repos/Z2l0aHViJTNBJTNBV2VhdGhlckRhdGFKcCUzQSUzQXJ5bzQ2MDA=/docs/syeu9).
30 changes: 30 additions & 0 deletions .swm/port-variable.985af.sw.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
id: 985af
name: PORT variable
file_version: 1.0.2
app_version: 0.6.9-0
file_blobs:
server/src/app.js: 2b4d3eefc3202bdd947707cd82a34284004828a9
---

Port number is configured as an environment variable.

For Heroku deployment, PORT is configured by the service, so there is no need to specify the variable.

<br/>

<!-- NOTE-swimm-snippet: the lines below link your snippet to Swimm -->
### 📄 server/src/app.js
```javascript
⬜ 2 const express = require("express");
⬜ 3 const cors = require('cors')
⬜ 4
🟩 5 const HTTP_PORT = process.env.PORT || 9000
⬜ 6
⬜ 7 const db = require("./utils/db_handler");
⬜ 8 const {forwardGeocoding, reverseGeocoding} = require("./utils/geocode");
```

<br/>

This file was generated by Swimm. [Click here to view it in the app](https://app.swimm.io/repos/Z2l0aHViJTNBJTNBV2VhdGhlckRhdGFKcCUzQSUzQXJ5bzQ2MDA=/docs/985af).
6 changes: 6 additions & 0 deletions .swm/swimm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"repo_id": "Z2l0aHViJTNBJTNBV2VhdGhlckRhdGFKcCUzQSUzQXJ5bzQ2MDA=",
"configuration": {
"swmd": true
}
}
2 changes: 1 addition & 1 deletion frontend/src/config.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"SERVER_URL": "http://localhost:9000",
"SERVER_URL": "http://localhost:9005",
"TITLE": "いつもの天気Jp"
}
5 changes: 4 additions & 1 deletion server/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ const path = require("path");
const express = require("express");
const cors = require('cors')

const HTTP_PORT = process.env.PORT || 9000
const getPort = () => 9000
//const getPort = () => process.env.PORT || 9000

const HTTP_PORT = getPort()

const db = require("./utils/db_handler");
const {forwardGeocoding, reverseGeocoding} = require("./utils/geocode");
Expand Down