In Parse Server, where should you put express routes? I found they only work if I put them straight in index.js, but that can't be the best place, is it?
I put this in my cloud/main.js:
var express = require('express');
var app = express();
app.listen();
app.get('/test', function(req, res) {
console.log("working?");
res.status(200).send('working?');
});
console.log("this file definitely runs");
My console output shows "this file definitely runs" on starting the server, but when I try to access localhost:1337/test, it just says "Cannot GET /test". Whereas if I put just the app.get('/test', ...); in index.js, it works. I suppose it's because I'm not allowed to create another express() instance, maybe there's a way to get the instance that was created in index.js?