0

I'm trying to create a loopback project, in which the client application will load in localhost:3000.

So I defined in server/server.js:

var path = require('path');
app.use(loopback.static(path.resolve(__dirname, '../client')));

Where client is the directory of the frontend files I would like to be presented in localhost:3000. However, when entering localhost:3000, I still see the message

'{"started":"2014-11-17T12:38:58.258Z","uptime":586.385}'

instead of index.html.

How can I redirect the entry point from that, to client/index.html?

Thank you

Ben Fortune
  • 31,623
  • 10
  • 79
  • 80
Ana M
  • 657
  • 6
  • 9

1 Answers1

3

delete '/server/boot/root.js' and it should work

superkhau
  • 2,781
  • 18
  • 9
  • 1
    @Nachi - this is the answer to the question. i know because the op only sees the "started" message because the of the default route set in `/server/boot/root.js`. Once this file is removed, LoopBack will automatically serve '/client/index.html'. thank for info on commenting below their post, i will do that next time i need clarification. – superkhau Nov 17 '14 at 17:54