I'm new to nextjs and node-solid-server. I have a simple application with node and nextjs. In my api/solid rout of my application, I'm trying to add a solid server as a middleware like this:
const Ldnode = require('ldnode')
const Solid = require('solid-server')
import initMiddleware from '../../lib/init-middleware'
// Initialize the cors middleware
const solid = initMiddleware(
Solid()
)
export default async function handler(req, res) {
// Run solid
await solid(req, res)
// Rest of the API logic
res.json({ message: 'Hello Everyone!' })
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
export default function initMiddleware(middleware) {
return (req, res) =>
new Promise((resolve, reject) => {
middleware(req, res, (result) => {
if (result instanceof Error) {
return reject(result)
}
return resolve(result)
})
})
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.6.3/umd/react.production.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.6.3/umd/react-dom.production.min.js"></script>
http://localhost:3000/api/solid in my browser, I just have the index.html of solid server with no functionality as the image below:
I also got GET http://localhost:3000/api/solid 401 (Unauthenticated) and GET http://localhost:3000/common/css/bootstrap.min.css net::ERR_ABORTED 404 (Not Found).
Did I miss something?