-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: merged conflicts with refactored code
- Loading branch information
Showing
11 changed files
with
213 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
lib/Minimax.md | ||
lib/ProjectExplanation.md | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/** This file is only added to run a development static server. */ | ||
|
||
import path from 'path'; | ||
import { fileURLToPath } from 'url'; | ||
import os from 'os'; | ||
import fastify from 'fastify'; | ||
import fastifyStatic from '@fastify/static'; | ||
|
||
const networkInterfaces = os.networkInterfaces(); | ||
const __filename = fileURLToPath(import.meta.url); | ||
const __dirname = path.dirname(__filename); | ||
const PORT = process.env.PORT || 3000; | ||
const app = fastify({ | ||
logger: false, | ||
}); | ||
|
||
app.register(fastifyStatic.default, { | ||
root: path.join(__dirname, 'lib'), | ||
}); | ||
|
||
app.get('/register', (req, res) => { | ||
res.sendFile('index.html'); | ||
}); | ||
|
||
start(); | ||
showlocalNetAddress(PORT); | ||
|
||
function showlocalNetAddress(PORT) { | ||
console.log(`local : localhost:${PORT}/`); | ||
|
||
const localNetAddress = | ||
networkInterfaces?.wlp2s0?.[0]?.address || | ||
networkInterfaces?.enp3s0f1?.[0]?.address || | ||
networkInterfaces?.['Wi-Fi']?.[1]?.address || | ||
networkInterfaces?.Ethernet?.[1]?.address || | ||
null; | ||
|
||
if (localNetAddress) { | ||
console.log(`network : ${localNetAddress}:${PORT}/`); | ||
} else { | ||
console.log('network : Not Available'); | ||
} | ||
} | ||
|
||
async function start () { | ||
try { | ||
await app.listen({ port: PORT, host: '::' }); | ||
} catch (err) { | ||
app.log.error(err); | ||
process.exit(1); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/* this file is only added to show the minimax-tic-tac-toe in action */ | ||
|
||
* { | ||
padding: 0px; | ||
margin: 0px; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.