twilio-labs / dev-phone

A developer tool for testing SMS and Voice applications
MIT License
77 stars 20 forks source link

Default proxy target for dev server in webpack.config.js #181

Closed hatealgebra closed 1 year ago

hatealgebra commented 1 year ago

Hello,

when I was setting up the dev env for the frontend, I needed to change the proxy target from 3001 to 1337 in webpack.config.js.

Here is the original setup for the devServer key in the file:

...
devServer: {
        static: {
          directory: path.join(__dirname, 'public'),
        },
        proxy: {
            '**': {
                target: 'http://localhost:3001',
                bypass: (req) => (req.headers.accept.includes("html") ? "/" : null)
            },
        },
        compress: true,
        hot: true,
        port: 3000,
    },
...

Link to the file: https://github.com/twilio-labs/dev-phone/blob/ae08110f3d551b2fbd12c980268df7b2c65aa174/packages/dev-phone-ui/webpack.config.js#L21C9-L21C9

I suggest changing to 1337 permanently. This would be nice for newcomers like me, just to run the command without editing the original port.

Let me know, if it does make sense and I will do a pull request.

ayyrickay commented 1 year ago

@hatealgebra yep, this makes sense. I think it's a missed detail from #138 - thanks for catching it!

hatealgebra commented 1 year ago

Hi @ayyrickay,

I Iust wanted to push changes to the separate branch for this issue, but I get the permission denied error on the push. I need to be added to the team/repo right? Or am I missing something?

Thanks for the help.

ayyrickay commented 1 year ago

@hatealgebra You should be able to create a fork of this repository and open pull requests that way. It'll feel a bit clunky at first, but you can see how it works here: https://docs.github.com/en/get-started/quickstart/contributing-to-projects

hatealgebra commented 1 year ago

Hello @ayyrickay thanks for the link! I've created and linked the PR to this issue. If I did not align with best practises, please let me know! :)

hatealgebra commented 1 year ago

@ayyrickay

Hi, I've closed this issue since the PR is closed. Hope you don't mind