react-multi-carousel-jsm
Version:
Production-ready, lightweight fully customizable React carousel component that rocks supports multiple items and SSR(Server-side rendering) with typescript.
25 lines (19 loc) • 532 B
text/typescript
import express from "express";
import next from "next";
import path from "path";
import routes from "../routes";
const port = parseInt(process.env.PORT, 10) || 3000;
const dev = process.env.NODE_ENV !== "production";
const app = next({ dev, dir: "." });
const handle = routes.getRequestHandler(app);
function createServer(): any {
const server = express();
server.get("*", (req, res) => {
handle(req, res);
});
return server;
}
const server = createServer();
app.prepare().then(() => {
server.listen(port);
});