I am using the back4app BaaS service, which uses Parse-Server. For ClientSide, I run AngularJS with html5Mode (true);
My problem is that this does NOT work: http://app.rizop.tv/dashboard Although this works correctly: http://app.rizop.tv
Any idea how to fix expressJS to properly handle my routes?
I have this configuration:
cloud \ app.js
// Helper modules that will be used var path = require('path'); var bodyParser = require('body-parser') // This imports the Router that uses the template engine var index = require('./routers/index'); // Sets the template engine as EJS app.set('view engine', 'ejs'); // This defines that the 'views' folder contains the templates app.set('views', path.join(__dirname, '/views')); // These options are necessary to app.use(bodyParser.urlencoded({ extended: false })) app.use(bodyParser.json()) // This bind the Router to the / route app.use('/', index) // Starts listening in the routes app.listen();
cloud \ routers \ index.js
// Importing express var express = require('express'); // Creating a Router var route = express.Router(); // Defining a route that binds the GET method route.get('/', function(req, res) { // This is the code that renders the template res.render('index', {testParam: 'Back4Apper'}); }); module.exports = route;
cloud \ view \ index.ejs
<!doctype html> <html> <head> <meta charset="utf-8"> ... </body> ... </body> </html>
Here is my application structure:

javascript angularjs express parse-server back4app
lito
source share