nestjs / typescript-starter

Nest framework TypeScript starter :coffee:
https://nestjs.com
1.89k stars 1.07k forks source link

Script to start Nest.JS with a Public URL Tunneling to your local #274

Closed robbie-cahill closed 1 year ago

robbie-cahill commented 1 year ago

This is a simple npm script to start NestJS locally with a Public URL forwarding to your local.

Behind the scenes, this uses Tunnelmole as an npm dependency.

Some possible use cases

I've updated the README with instructions to run the script. To try it out, run npm run start:public.

Here is an example:

npm run start:public

> nest-typescript-starter@1.0.0 start:public
> concurrently "npm:start" "tmole 3000"

[start]
[start] > nest-typescript-starter@1.0.0 start
[start] > nest start
[start]
[1] http://6zq3zu-ip-157-211-196-28.tunnelmole.com is forwarding to localhost:3000
[1] https://6zq3zu-ip-157-211-196-28.tunnelmole.com is forwarding to localhost:3000
[start] [Nest] 90974  - 21/04/2023, 8:12:08 pm     LOG [NestFactory] Starting Nest application...
[start] [Nest] 90974  - 21/04/2023, 8:12:08 pm     LOG [InstanceLoader] AppModule dependencies initialized +32ms
[start] [Nest] 90974  - 21/04/2023, 8:12:08 pm     LOG [RoutesResolver] AppController {/}: +2ms
[start] [Nest] 90974  - 21/04/2023, 8:12:08 pm     LOG [RouterExplorer] Mapped {/, GET} route +2ms
[start] [Nest] 90974  - 21/04/2023, 8:12:08 pm     LOG [NestApplication] Nest application successfully started +1ms

In this example, hitting any of the Tunnelmole URLs shown will forward to your local NestJS application.

Everything is installed through npm and there is no need to install anything separately for this to work.

kamilmysliwiec commented 1 year ago

Thanks for your suggestion!

There are no plans to add this in the foreseeable future.

If you think your request could live outside Nest's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.