
The reason is that the global define() function doesn't exist unless your using an AMD loader like Require.js. The problem with wrapping a JavaScript file in this kind of function is that it breaks it's ability to work with normal HTML files that call JavaScript files with a tag. This is a best practice that helps with maintenance and collaboration. It allows complex JavaScript programs to be modularized into small files that are mission specific.JavaScript files can be called on an as-needed basis rather than front loading everything, thus improving performance.Race conditions are avoided by loading scripts in an explicit order.This format allows the file to explicity call out any files it depends on so that a library like Require.js can load all the files in the right order. e('/server-health', require('./createHealthchecksHandler')(keystone)) This API allows one to log in remotely, which is what I would need while developing the Vue.js application on my dev box.Īs it turned out, I needed to edit the node_modules/keystone/admin/server/app/createDynamicRouter.js file in my KeystoneJS installation, and add these lines to it: I was after the new(ish) Admin API in KeystoneJS core. However, I wasn't after the regular API routes.

However these two threads lead me to get CORS working for the regular API routes, like ConnextCMS uses. Something had changed in KeystoneJS core since I wrote that article. The first thing I tried was this old article that covers it, but it didn't work. I needed to enable CORS on the server so that my dev box could communicate with it. I'm setting up a dev server for a new open source project I'm working on: P2P VPS.
