From cd26f2905735be66a667fe1b68609c6ea53064fd Mon Sep 17 00:00:00 2001 From: Jayson Ng Date: Wed, 10 Jan 2024 17:56:33 +0800 Subject: [PATCH] Update usage.md For await to work, it needs to be inside an async function. or else an error will occur ```SyntaxError: await is only valid in async functions and the top level bodies of modules``` --- _includes/parse-server/usage.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/_includes/parse-server/usage.md b/_includes/parse-server/usage.md index 370221cb..e0541140 100644 --- a/_includes/parse-server/usage.md +++ b/_includes/parse-server/usage.md @@ -42,7 +42,9 @@ const ParseServer = require('parse-server').ParseServer; const app = express(); const api = new ParseServer({ ... }); -await api.start(); +(async() => { + await api.start(); +})(); // Serve the Parse API at /parse URL prefix app.use('/parse', api.app);