Coder Social home page Coder Social logo

Comments (4)

j8 avatar j8 commented on July 30, 2024

You should create a backend to provide an API and use AngularJS service + connect it to the routes using the resolve property. This is more question for stackoverflow instead of here.

from angular-client-side-auth.

michaeljoser avatar michaeljoser commented on July 30, 2024

oups i probably phrased that question wrong... I am actually using angular-client-side-auth for my project... what i'm confused is why does /users give me the users in JSON format but the ones i declared in express server.js

app.get('/api/1/messages', function(req, res) { ...
...
...

those will result in Angular giving me a 404

from angular-client-side-auth.

michaeljoser avatar michaeljoser commented on July 30, 2024

[SOLVED]

found this in route.js

    // User resource
    {
        path: '/users',
        httpMethod: 'GET',
        middleware: [UserCtrl.index],
        accessLevel: accessLevels.admin
    },

so i'm basically creating new resources/models/controllers to satisfy my API needs :)

from angular-client-side-auth.

fnakstad avatar fnakstad commented on July 30, 2024

Yep! You have to declare the the actual URL route on the server-side. If not it will be caught by a catchall route which will "delegate" the routing to the client-side Angular routing (from a server-side perspective it will just return the index site, which will cause Angular to check the route provided when it has been loaded). It works like this because I wanted pretty, "html5mode" url's on the client side :)

from angular-client-side-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.