Skip to content

Commit 1a10992

Browse files
committed
updates for plain JS template
1 parent 61bb050 commit 1a10992

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"start": "remotion preview src/index.jsx",
77
"build": "remotion render src/index.jsx HelloWorld out.mp4",
88
"upgrade": "remotion upgrade",
9-
"server": "node server.jsx",
9+
"server": "node server.mjs",
1010
"test": "eslint src --ext ts,tsx,js,jsx && tsc"
1111
},
1212
"repository": {},

server.jsx renamed to server.mjs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ const app = express();
2020
const port = process.env.PORT || 8000;
2121
const compositionId = 'HelloWorld';
2222

23-
const cache = new Map<string, string>();
23+
const cache = new Map();
2424

2525
app.get('/', async (req, res) => {
26-
const sendFile = (file: string) => {
26+
const sendFile = (file) => {
2727
fs.createReadStream(file)
2828
.pipe(res)
2929
.on('close', () => {
@@ -32,10 +32,10 @@ app.get('/', async (req, res) => {
3232
};
3333
try {
3434
if (cache.get(JSON.stringify(req.query))) {
35-
sendFile(cache.get(JSON.stringify(req.query)) as string);
35+
sendFile(cache.get(JSON.stringify(req.query)));
3636
return;
3737
}
38-
const bundled = await bundle(path.join(__dirname, './src/index.tsx'));
38+
const bundled = await bundle(path.join(process.cwd(), './src/index.jsx'));
3939
const comps = await getCompositions(bundled);
4040
const video = comps.find((c) => c.id === compositionId);
4141
if (!video) {

0 commit comments

Comments
 (0)