-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
1,354 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,3 +28,7 @@ APP_SECRET=0aabd8ac1e1554db5b50ca9d54ad796c | |
# DATABASE_URL="mysql://app:[email protected]:3306/app?serverVersion=10.11.2-MariaDB&charset=utf8mb4" | ||
DATABASE_URL="postgresql://app:[email protected]:5432/app?serverVersion=16&charset=utf8" | ||
###< doctrine/doctrine-bundle ### | ||
|
||
###> nelmio/cors-bundle ### | ||
CORS_ALLOW_ORIGIN='^https?://(localhost|127\.0\.0\.1)(:[0-9]+)?$' | ||
###< nelmio/cors-bundle ### |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
web: vendor/bin/heroku-php-nginx -C nginx.conf -F fpm_custom.conf public/ | ||
# release: bin/console tailwind:build && bin/console importmap:install && bin/console asset-map:compile | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
{ | ||
"name": "phpwa-demo", | ||
"description": "A repo, maybe get this from github", | ||
"keywords": [ | ||
"php", | ||
"symfony" | ||
], | ||
"repository": "https:\/\/github.com\/survos-sites\/phpwa-demo", | ||
"scripts": { | ||
"dokku": { | ||
"predeploy": "bin/console tailwind:build && bin\/console importmap:install && bin\/console asset-map:compile", | ||
"postdeploy": "" | ||
} | ||
}, | ||
"env": { | ||
"SECRET_TOKEN": { | ||
"description": "A secret key for verifying the integrity of signed cookies.", | ||
"value": "secret" | ||
}, | ||
"WEB_CONCURRENCY": { | ||
"description": "The number of processes to run.", | ||
"generator": "echo 5" | ||
} | ||
}, | ||
"image": "gliderlabs\/herokuish", | ||
"addons": [ | ||
"dokku-postgres", | ||
"dokku-redis" | ||
], | ||
"buildpacks": [ | ||
{ | ||
"url": "https:\/\/github.com\/heroku\/heroku-buildpack-php.git" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import { startStimulusApp } from '@symfony/stimulus-bundle'; | ||
import Timeago from 'stimulus-timeago' | ||
|
||
const app = startStimulusApp(); | ||
// register any custom, 3rd party controllers here | ||
// app.register('some_controller_name', SomeImportedController); | ||
app.register('timeago', Timeago); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { Controller } from '@hotwired/stimulus'; | ||
|
||
/* | ||
* The following line makes this controller "lazy": it won't be downloaded until needed | ||
* See https://github.com/symfony/stimulus-bridge#lazy-controllers | ||
*/ | ||
/* stimulusFetch: 'lazy' */ | ||
export default class extends Controller { | ||
static targets = ['list', 'message'] | ||
static values = { | ||
collectionUrl: String, | ||
} | ||
// ... | ||
connect() { | ||
this.messageTarget.innerHTML = 'fetching ' + this.collectionUrlValue; | ||
this.loadList(); | ||
} | ||
|
||
|
||
async loadList() { | ||
try { | ||
// this endpoint will return CORS error | ||
const response = await fetch(this.collectionUrlValue); | ||
if (!response.ok) { | ||
throw new Error("Network response was not OK"); | ||
this.errorTarget.innerHTML = 'unable to fetch items at this time.'; | ||
console.error('Failed'); | ||
return; | ||
} else { | ||
// promise resolved. | ||
const items = await response.json(); | ||
const count = items['hydra:totalItems']; | ||
this.messageTarget.innerHTML = `${count} total items`; | ||
|
||
this.listTarget.innerHTML = '<ol>' | ||
for (const item of items['hydra:member']) { | ||
// this.listTarget.innerHTML += `<li>${item.name}</li>`; | ||
console.log(item); | ||
} | ||
this.listTarget.innerHTML += `</ol>`; | ||
|
||
console.log(items); | ||
|
||
} | ||
} catch { | ||
this.messageTarget.innerHTML = 'unable to fetch items at this time.'; | ||
console.error('Failed'); | ||
return; | ||
} | ||
} | ||
|
||
refresh() { | ||
this.loadList(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.