elliotk

Experience

10,150

0 Best Reply Awards

  • Member Since 5 Months Ago
  • 100 Lessons Completed
  • 0 Favorites

14th May, 2017

elliotk left a reply on API Working In Local, But 405 In Production • 2 months ago

All sorted.

Had to edit: /etc/nginx/webapps.hostname.conf

I've added PATCH and DELETE and it now works as expected.

if ($request_method !~ ^(GET|HEAD|POST|PATCH|DELETE)$ ) {
                return 444;
        }

Thanks for all your help.

elliotk left a reply on API Working In Local, But 405 In Production • 2 months ago

I wasn't really keen on installing the module, I see there are a lot of security concerns around that module. Instead, I have installed nginx.

Just got that up and running, hoping for no errors, but unfortunately, it's a new error now.

app.js:655 PATCH http://fastfrag.co.uk/replies/2 net::ERR_EMPTY_RESPONSE
app.js:717 Uncaught (in promise) Error: Network Error
    at createError (app.js:717)
    at XMLHttpRequest.handleError (app.js:567)

elliotk left a reply on API Working In Local, But 405 In Production • 2 months ago

Thanks Tim, appreciate your help.

So, looking in my routes, i think it looks good. And as I said in my original post, it does work fine using valet on my local machine.

Route::delete('/replies/{reply}', [email protected]'); Route::patch('/replies/{reply}', [email protected]');

How would I check what endpoint my Javascript is connected to?

In my Reply.vue file, I am calling destroy as follows

`destroy () { axios.delete('/replies/' + this.attributes.id);

            $(this.$el).fadeOut(300, () => {
                flash('Reply has been updated!');
            });
        }`

and for update

`update () { axios.patch('/replies/' + this.attributes.id, { body: this.body });

            this.editing = false;
            flash('Reply has been updated!');
        },`

13th May, 2017

elliotk left a reply on API Working In Local, But 405 In Production • 2 months ago

It's a good point, I wouldn't have it on normally, I just set debugging on to try and get some more details on what the issue is.

The UI might remove them / edit them, but if you refresh the page, you should see the changes don't apply and it reverts back to what it was before. That's the issue.

In chrome console I see the error throwing, hopefully you can see that too?

I'm not really sure how to debug further though.

elliotk started a new conversation API Working In Local, But 405 In Production • 2 months ago

Hello All,

I have been working through the forum series on here, and I have implemented the Vue delete and update on the forum reply section. In valet, it's working fine, but on my "production server" i get 405.

Please feel free to try it yourself....

http://www.fastfrag.co.uk

I get the following in the console.

app.js:717 Uncaught (in promise) Error: Request failed with status code 405 at createError (app.js:717) at settle (app.js:1270) at XMLHttpRequest.handleLoad (app.js:557)

Anyone come across this?

11th March, 2017

elliotk started a new conversation Using Bootswatch With Laravel 5.4 • 4 months ago

I thought I'd share how simple it is to use Bootswatch in Larvel 5.4 with this simple guide.

Create a fresh Laravel install.

laravel new mynewproject

Then, install the Bootswatch dependancies via npm.

npm install bootswatch

Following this, edit your resources/assets/saas/app.scss


// Fonts
@import url(https://fonts.googleapis.com/css?family=Raleway:300,400,600);

// Variables
// @import "variables"; - Default variables included with laravel no longer required

// Bootswatch Variables for your chosen theme
@import "node_modules/bootswatch/flatly/variables";

// Bootstrap
@import "node_modules/bootstrap-sass/assets/stylesheets/bootstrap";

// Bootswatch theme main CSS files
@import "node_modules/bootswatch/flatly/bootswatch";

Install your npm dependancies

npm install

Finally, compile your saas.

npm run dev

You should then be using your chosen Bootswatch theme, in this case "flatly"

26th February, 2017

Edit Your Profile
Update

Want to change your profile photo? We pull from gravatar.com.