Skip to content
New issue

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

Can I have a front-end page/endpoing that is not reflecting api? #68

Open
mikaelhm opened this issue Aug 14, 2014 · 3 comments
Open

Can I have a front-end page/endpoing that is not reflecting api? #68

mikaelhm opened this issue Aug 14, 2014 · 3 comments

Comments

@mikaelhm
Copy link
Contributor

I wanted to make a login page at /login, that I can redirect to whenever someone is not logged in.

I created a template front/login/getIndex.jade and setup the angularjs routes:

  .when('/login', {
    templateUrl: '/html/login/getIndex.html',
    controller: 'login'
  });

If I try to hit /login i get a 404. However, if I link to /login from within angularjs it works.

I then realized that the 404 was caused by the fact that I did not have a getIndex request handler defined in back/login. The server should properly log some error message in this case!

But, wouldn't it be nice to be able to have endpoints that does not require back-end data?

@JonAbrams
Copy link
Owner

Yup, the reverse would also be good, an API GET endpoint without an
associated view.

For now though, I'd just use express to create the endpoint you require in
back-app.js

On Thu, Aug 14, 2014 at 9:11 AM, Mikael Møller notifications@github.com
wrote:

I wanted to make a login page at /login, that I can redirect to whenever
someone is not logged in.

I created a template front/login/getIndex.jade and setup the angularjs
routes:

.when('/login', {
templateUrl: '/html/login/getIndex.html',
controller: 'login'
});

If I try to hit /login i get a 404. However, if I link to /login from
within angularjs it works.

I then realized that the 404 was caused by the fact that I did not have a
getIndex request handler defined in back/login. The server should
properly log some error message in this case!

But, wouldn't it be nice to be able to have endpoints that does not
require back-end data?


Reply to this email directly or view it on GitHub
#68.

@mikaelhm
Copy link
Contributor Author

Yup, the reverse would also be good, an API GET endpoint without an
associated view.

Doesn't that work already?

@JonAbrams
Copy link
Owner

Nope, it makes a view endpoint for all GET API handlers:
https://github.com/JonAbrams/synth/blob/master/synth.js#L121

On Thu, Aug 14, 2014 at 9:18 AM, Mikael Møller notifications@github.com
wrote:

Yup, the reverse would also be good, an API GET endpoint without an
associated view.

Doesn't that work already?


Reply to this email directly or view it on GitHub
#68 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants