Skip to content

pauldesmondparker/grpc-js-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple @grpc Example

Last Update: 20230823

Setup

Note

This repository does not include ANY code that can be generated. Therefore, for the example to work, you must first generate the grpc ts files with pnpm proto:gen.

Warning

Adding new files to the proto/ directory will not show up in unstaged files, you'll need to git add -f proto/new.proto to force add a new hypothetical proto file.

Important

Do NOT add any generated files in the proto/ directory. They are ignored for a reason. As a rule of thumb, do not add any .ts files in this directory.

# Install all dependencies
pnpm i
# Generate all ts files from proto/*.proto
pnpm proto:gen

Execution

pnpm startserver  # Use a separate pane/window
pnpm startclient

Notes

tsconfig.json

Note

Notice that there's no tsconfig file. For some reason, at present, ts-node doesn't work with any setup that I tried. Ref: TypeStrong/ts-node#1007

Note

Using ts-node with no tsconfig.json works with no issue.

About

Example usage of grpc-js

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published