Maybe this helps someone.
I figured out how to have internal routes used by the plugin, and routes that can be called externally.
This is the setup for …/routes/index.js
module.exports = {
admin: {
type: 'admin',
routes: [
{
// this route can be called externally (e.g. postman) through http://localhost:1337/api/{pluginID}/getCurrent with appropriate api token
method: 'GET',
path: '/getAll',
handler: 'myController.getAll',
config: {
policies: []
}
}
]
},
'content-api': {
type: 'content-api',
routes: [
{
// this route can be called by the plugin using request from '@strapi/helper-plugin' through /{pluginID}/getCurrent
method: 'GET',
path: '/getAll',
handler: 'myController.getAll',
config: {
policies: []
// auth: false
}
}
]
}
}
The routes under “content-api’” will show up in the api token creation menu so you can create the token for them.