chore: use a new port if existing port is in use (#199)

* 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
This commit is contained in:
Rahul Rana 2021-07-31 12:43:00 +05:30 committed by GitHub
parent 48e32878e6
commit 3acef9c86a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 4 deletions

1
frontend/.npmrc Normal file
View File

@ -0,0 +1 @@
registry = 'https://registry.npmjs.org/'

View File

@ -23,7 +23,7 @@ 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```
@ -31,7 +31,8 @@ Follow the steps below
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).

View File

@ -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",

View File

@ -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");
@ -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",

View File

@ -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==