0

I have an angularjs project that contains an oauth to github.

I use the satellizer plugin to deal with the oauth protocol.

Every time I try to connect I get this error:

enter image description here

Here is my route config (it's ES6 using Babel) :

export default function RouteConfig($routeProvider, $locationProvider) {

 $routeProvider
    .when('/', {
        templateUrl: './modules/default/default.html',
        controller: 'DefaultController',
        controllerAs: 'default'
    })
    .when('/auth/:provider',{
        controller: 'OAuthController',
        templateUrl: './modules/auth/auth.html',
    })
    .otherwise({
        redirectTo: '/'
    });
}

I tested the app using Postman, all the GET requests work fine but every POST request returns a 405.

I use live-server to host my angularJS application. I've read that the issue might be server-related. How can I solve that ?

I also use npm to deal with the packages.

**EDIT : ** I tried with simplehttpserver here is what I got:

enter image description here

TylerH
  • 20,799
  • 66
  • 75
  • 101
Giu
  • 1,832
  • 2
  • 16
  • 31

2 Answers2

1

well as it seems you do an http POST call somewhere in your application. and you send this request to

http://localhost:8080/src/auth/callback

as it seems there is no server listening - or at least not to a POST request. probably you will have to find the http request in your code and check whether you're using the correct url for your request

Patrick Kelleter
  • 2,631
  • 1
  • 13
  • 19
  • The url is fine, I defined that path in my routeconfig and I am able to get the values using a GET request, I don't understand why the POST request is not allowed – Giu Feb 05 '16 at 18:16
-1

I finally figured out. AngularJS cannot deal with POST requests, it's the server responsibility to do that, I forgot to start and add code for the server.

For those who will have the same issue than me, examples are here:

https://github.com/sahat/satellizer/tree/master/examples

Giu
  • 1,832
  • 2
  • 16
  • 31