-
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.
- Loading branch information
1 parent
69fc3a7
commit f80d689
Showing
8 changed files
with
1,080 additions
and
1 deletion.
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 |
---|---|---|
|
@@ -285,4 +285,4 @@ log/ | |
logs | ||
*.log% | ||
*.log | ||
example* | ||
lib |
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 @@ | ||
node_modules |
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 @@ | ||
v18.16.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
const logger = require('code-logger'); | ||
const express = require('express'); | ||
|
||
const app = express(); | ||
|
||
const PORT = process.env.PORT || 5000; | ||
|
||
app.get('/', (req, res) => { | ||
console.log('do-console....'); | ||
console.log(logger.helpers.isApiEnabled()); | ||
res.json({ message: 'test' }); | ||
}); | ||
|
||
app.get('/do-start', (req, res) => { | ||
console.log('do-start....'); | ||
logger.doStart(); | ||
logger.helpers.setApi('https://test.in.sg'); | ||
res.json({ message: 'test' }); | ||
}); | ||
|
||
app.get('/do-stop', (req, res) => { | ||
console.log('do-stop....'); | ||
logger.doStop(); | ||
res.json({ message: 'test' }); | ||
}); | ||
|
||
app.listen(PORT, () => { | ||
console.log(`server is running on port: ${PORT}`) | ||
}); | ||
|
||
const gFetch = global.fetch; | ||
|
||
global.fetch = async (...args) => { | ||
// console.log('arguments: ', args); | ||
return gFetch.apply(this, args); | ||
} | ||
|
||
fetch('http://google.com').then(data => { console.log('data.ok: ', data.ok) }).catch((error) => { console.log('error:', error) }); |
Oops, something went wrong.