card-next.js 537 B

12345678910111213141516171819202122
  1. /*
  2. * @Description:
  3. * @Author: zhb
  4. * @version:
  5. * @Date: 2024-09-13 13:25:59
  6. */
  7. const { createServer } = require('http');
  8. const { parse } = require('url');
  9. const next = require('next');
  10. const app = next({ dev: false });
  11. const handle = app.getRequestHandler();
  12. app.prepare().then(() =>
  13. {
  14. createServer((req, res) =>
  15. {
  16. // Be sure to pass `true` as the second argument to `url.parse`.
  17. // This tells it to parse the query portion of the URL.
  18. handle(req, res, parse(req.url, true));
  19. }).listen(30002, '0.0.0.0', () => {});
  20. });