An easy-to-use platform for EEG experimentation in the classroom
1import chalk from 'chalk';
2import detectPort from 'detect-port';
3
4const port = process.env.PORT || '1212';
5
6detectPort(port, (err, availablePort) => {
7 if (port !== String(availablePort)) {
8 throw new Error(
9 chalk.whiteBright.bgRed.bold(
10 `Port "${port}" on "localhost" is already in use. Please use another port. ex: PORT=4343 yarn dev`
11 )
12 );
13 } else {
14 process.exit(0);
15 }
16});