Skip to content

Commit

Permalink
chore: use a new port if existing port is in use (#199)
Browse files Browse the repository at this point in the history
* BugFix:Open a new port on local dev server if existing port is being used.

* Update Read me and dev dependcies

* Fix yarn package and add npmrc file
  • Loading branch information
rahulrana95 committed Jul 31, 2021
1 parent 48e3287 commit 3acef9c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 4 deletions.
1 change: 1 addition & 0 deletions frontend/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry = 'https://registry.npmjs.org/'
5 changes: 3 additions & 2 deletions frontend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,16 @@ docker-compose up
```

## Without Docker
Follow the steps below
Follow the steps below

1. ```git clone https://github.com/SigNoz/signoz.git && cd signoz/frontend```
1. change baseURL to ```<test environment URL>``` in file ```src/constants/env.ts```

1. ```yarn install```
1. ```yarn dev```

```Note: Please ping us in #contributing channel in our slack community and we will DM you with <test environment URL>```
```Note: Please ping us in #contributing channel in our slack community and we will DM you with <test environment URL>```

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
Expand Down
1 change: 1 addition & 0 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"less-plugin-npm-import": "^2.1.0",
"lint-staged": "10.5.3",
"lodash-es": "^4.17.21",
"portfinder-sync": "^0.0.2",
"prettier": "2.2.1",
"react-hot-loader": "^4.13.0",
"react-is": "^17.0.1",
Expand Down
5 changes: 4 additions & 1 deletion frontend/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// shared config (dev and prod)
const { resolve } = require("path");
const HtmlWebpackPlugin = require("html-webpack-plugin");
const portFinderSync = require('portfinder-sync')
const dotenv = require("dotenv");
const webpack = require("webpack");

Expand All @@ -22,7 +23,9 @@ module.exports = {
hot: true,
liveReload: false,
inline: true,
port: 3000,
// This is being used because if the port 3000 is being used
// then it will try to find another open port availble.
port: portFinderSync.getPort(3000),
},
output: {
filename: "js/bundle.[chunkhash].min.js",
Expand Down
10 changes: 9 additions & 1 deletion frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10094,7 +10094,15 @@ polished@^4.1.2:
dependencies:
"@babel/runtime" "^7.13.17"

portfinder@^1.0.26:
portfinder-sync@^0.0.2:
version "0.0.2"
resolved "https://registry.yarnpkg.com/portfinder-sync/-/portfinder-sync-0.0.2.tgz#6e3409a73a718436de053ac949385350caabd8a2"
integrity sha1-bjQJpzpxhDbeBTrJSThTUMqr2KI=
dependencies:
minimist "^1.2.0"
portfinder "^1.0.10"

portfinder@^1.0.10, portfinder@^1.0.26:
version "1.0.28"
resolved "https://registry.yarnpkg.com/portfinder/-/portfinder-1.0.28.tgz#67c4622852bd5374dd1dd900f779f53462fac778"
integrity sha512-Se+2isanIcEqf2XMHjyUKskczxbPH7dQnlMjXX6+dybayyHvAf/TCgyMRlzf/B6QDhAEFOGes0pzRo3by4AbMA==
Expand Down

0 comments on commit 3acef9c

Please sign in to comment.