We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I tried to locate my canvas dashboard on the subdomain http://dashboard.blog.test/ at the root level.
http://dashboard.blog.test/
So my files look like this :
config/canvas.php
return [ 'domain' => env('CANVAS_DOMAIN', null), 'path' => env('CANVAS_PATH', 'canvas'), ... ]
.env
CANVAS_DOMAIN=dashboard.blog.test CANVAS_PATH=
When I try to add a Featured image on a random post I get an error in the console :
POST http://api/uploads net::ERR_NAME_NOT_RESOLVED
The image should be uploaded on the right url :
POST http://dashboard.blog.test/api/uploads
composer create-project --prefer-dist laravel/laravel blog
Add a database for your project
Add Canvas :
composer require austintoddj/canvas
php artisan canvas:install
APP_URL=http://blog.test DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=3306 DB_DATABASE=blog CANVAS_DOMAIN=dashboard.blog.test CANVAS_PATH=
PHP version : 8.1.1 Laravel version : 10.0.0 Database driver : 10.8.3-MariaDB Homebrew
This seems to be an error with the FeaturedImageModal.vue [ or EmbedImageModal.vue or AvatarModal.vue ]
resources/js/components/editor/FeaturedImageModal.vue file at line 230: or resources/js/components/modals/EmbedImageModal.vue file at line 234 :
getServerOptions() { return { url: `${this.settings.path}/api/uploads`, headers: { 'X-CSRF-TOKEN': document.head.querySelector('meta[name="csrf-token"]').content, }, }; },
the url line, when this.settings.path equals '' sets the url as /api/uploads. This will call the error url http://api/uploads
url
this.settings.path
/api/uploads
http://api/uploads
To make it work, I suppose we should have something like :
getServerOptions() { return { url: this.settings.path ? `${this.settings.path}/api/uploads` : `api/uploads` , headers: { 'X-CSRF-TOKEN': document.head.querySelector('meta[name="csrf-token"]').content, }, }; },
I found out you added this getServerOptions() on AvatarModal.vue file line 108 :
getServerOptions()
getServerOptions() { return { // TODO: This check shouldn't need to be here url: this.settings.path === '/' ? `/api/uploads` : `${this.settings.path}/api/uploads`, headers: { 'X-CSRF-TOKEN': document.head.querySelector('meta[name="csrf-token"]').content, }, }; },
But this seems incorrect if you set CANVAS_PATH="/" [ tricky I know ], should this be copy pasted to the two other files ?
I can try to make a PR for this if wanted ?
The text was updated successfully, but these errors were encountered:
Happy to check out a PR if you'd like to submit one 😄
Sorry, something went wrong.
No branches or pull requests
Is there an existing issue for this?
Current Behavior
I tried to locate my canvas dashboard on the subdomain
http://dashboard.blog.test/
at the root level.So my files look like this :
config/canvas.php
.env
When I try to add a Featured image on a random post I get an error in the console :
POST http://api/uploads net::ERR_NAME_NOT_RESOLVED
Expected Behavior
The image should be uploaded on the right url :
POST http://dashboard.blog.test/api/uploads
Steps To Reproduce
composer create-project --prefer-dist laravel/laravel blog
Add a database for your project
Add Canvas :
composer require austintoddj/canvas
php artisan canvas:install
.env
Environment
Anything else?
This seems to be an error with the FeaturedImageModal.vue [ or EmbedImageModal.vue or AvatarModal.vue ]
resources/js/components/editor/FeaturedImageModal.vue file at line 230:
or
resources/js/components/modals/EmbedImageModal.vue file at line 234 :
the
url
line, whenthis.settings.path
equals '' sets the url as/api/uploads
. This will call the error urlhttp://api/uploads
To make it work, I suppose we should have something like :
I found out you added this
getServerOptions()
on AvatarModal.vue file line 108 :But this seems incorrect if you set CANVAS_PATH="/" [ tricky I know ], should this be copy pasted to the two other files ?
I can try to make a PR for this if wanted ?
The text was updated successfully, but these errors were encountered: