This is an example of server-bridge in action.
-
server/src/NoteRoutes.ts
- Defines the routes for notes. -
server/src/index.ts
- Configures the server withexpress
and defines the routes. -
server/src/generateClientSideCode.ts
- Used bynpm run build
to generate the client-side code. -
client/src/server.ts
- The generated code. -
client/src/main.ts
- The client code that uses the generated code.
Run npm install
in both the client and server folders. Make sure port 8082
is open on your local computer.
-
Start the server by calling:
npm start
In the server folder.
-
Start the client by calling:
npm start
In the client folder.
Then follow the prompts in the client application.
Run npm run build
in the server application.