Closed DaisyMonte closed 5 years ago
Hi @DaisyMonte, can you send me your source code to my email address? It's a bit complicated for me because I need to see your entire code. But:
404
flag from F.route('/*')
because it's not a regular flag/optionF.route()
use ROUTE()
methodThis is a clearer code:
exports.install = function() {
// Routes
ROUTE('POST /start/{type}/', Assessment.canvas); // Canvas
ROUTE('POST /assessment/{type}/', Assessment.assessments, ['xhr']); // Assessments
ROUTE('GET /*', Assessment.genericPage);
// Enables CORS for all routes
CORS();
};
Thank you!
Hi Peter!
I followed your instructions, but the CORS() statement did not work with the version of the framework I was using in the project (2.9.1). It's an old project, so I upgraded TotalJS, reinstalled the packages with npm, made the necessary adjustments and it worked perfectly! Thank you very much!
default
const AssessmentController = require('./assessment'); // AssessmentController
let Assessment = new AssessmentController(); // Instance AssessmentController
exports.install = function() {
ROUTE('POST start/{type}', Assessment.canvas); // Canvas
ROUTE('POST assessment/{type}', Assessment.assessments, ['xhr']); // Assessments (/abas or /cards)
ROUTE('#404', Assessment.genericPage); // System routing - 404
CORS();
};
config
name : Behavioral Assessment
author : Daisy Machado
canvas_api : URL API Rest here
canvas_token : Token API Rest Here
default_root : /behavioral
Hi Peter, I have a route problem that I can't solve. In the development environment, my default route is empty. On the server, the default route is /behavioral.
In the development environment, all routes work. On the server, the system routing (404) do not work, but the others routes work.
I am using apache with reverse proxy. Can you help me?
default.js
config
For now, I do not make GET calls, so I could do something like this:
404 with error on my server:
404 running in the development environment:
Thank you!!!