We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I don't want to use express, just next, is there a way to customize this for next only?
const {createServer} = require('http'); const {join} = require('path'); const {parse} = require('url'); const next = require('next'); const routes = require('./src/routes'); const port = parseInt(process.env.PORT, 10) || 4000; const dev = process.env.NODE_ENV !== 'production'; const app = next({dev}); const handler = routes.getRequestHandler(app); app.prepare() .then(() => { createServer((req, res) => { const parsedUrl = parse(req.url, true); const {pathname} = parsedUrl; if (pathname === '/service-worker.js') { const filePath = join(__dirname, '.next', pathname); app.serveStatic(req, res, filePath) } else { handler(req, res, parsedUrl) } }).listen(port, (err) => { if (err) throw err; console.log(`> Ready on http://localhost:${port}`) }); });
The text was updated successfully, but these errors were encountered:
Duplicate of #274.
Sorry, something went wrong.
No branches or pull requests
I don't want to use express, just next, is there a way to customize this for next only?
The text was updated successfully, but these errors were encountered: