The client is served up by the webapp package. You can’t remove this package, but you can overwrite the client output completely by using any Connect-style middleware and then calling WebApp.connectHanders.use at the root url.
For example, if you want to build an api with Express, you can include the following server code:
import { WebApp } from 'meteor/webapp'
import express from 'express'
const app = express()
app.use('/example-api-route', function(req, res) {
res.headers = {
'Content-Type': 'application/json'
}
res.end(JSON.stringify({
message: "hello"
}))
})
app.use('/', function(req, res) {
// This will overwrite Meteor webapp client
res.end()
}
// No need to 'listen' as this is already done by WebApp
WebApp.connectHandlers.use('/', app)
You’ll see that none of the client scripts are loaded.