Skip to content

Commit

Permalink
f docs
Browse files Browse the repository at this point in the history
  • Loading branch information
pcattori committed Jun 16, 2023
1 parent ccbc91e commit 2adc52b
Showing 1 changed file with 33 additions and 1 deletion.
34 changes: 33 additions & 1 deletion docs/other-api/dev-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -249,12 +249,44 @@ For example, here's how you could use HTTPS with an Express server:
```ts filename=server.js
import fs from "node:fs";
import https from "node:https";
import path from "node:path";

import express from "express";

const BUILD_DIR = path.resolve(__dirname, "build");
const build = require(BUILD_DIR);

const app = express();

// ... code setting up your express app goes here ...

//
let server = https.createServer(
{
key: fs.readFileSync("path/to/key.pem"),
cert: fs.readFileSync("path/to/cert.pem"),
},
app
);

let port = 3000;
server.listen(port, () => {
console.log(`👉 https://localhost:${port}`);

if (process.env.NODE_ENV === "development") {
broadcastDevReady(build);
}
});
```

### Limitations

hmr: key
hmr: hooks (useloaderdata change)
hdr: harmless console errors
hdr: perf
hdr: sideeffects false

[templates]: https://github.com/remix-run/remix/tree/main/templates
[watch-paths]: https://remix.run/docs/en/1.17.1/file-conventions/remix-config#watchpaths
[jenseng-code]: https://github.com/jenseng/abuse-the-platform/blob/main/app/utils/singleton.ts
[jenseng-talk]: https://www.youtube.com/watch?v=lbzNnN0F67Y

0 comments on commit 2adc52b

Please sign in to comment.