File tree Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Expand file tree Collapse file tree 2 files changed +41
-1
lines changed Original file line number Diff line number Diff line change 1+ const path = require ( 'path' ) ;
2+ const { release, version } = require ( 'os' ) ;
3+ const { createServer : createServerHttp } = require ( 'http' ) ;
4+ require ( './files/c.cjs' ) ;
5+
6+ const random = Math . random ( ) ;
7+
8+ let unknownObject ;
9+
10+ if ( random > 0.5 ) {
11+ unknownObject = require ( './files/a.json' ) ;
12+ } else {
13+ unknownObject = require ( './files/b.json' ) ;
14+ }
15+
16+ console . log ( `Release ${ release ( ) } ` ) ;
17+ console . log ( `Version ${ version ( ) } ` ) ;
18+ console . log ( `Path segment separator is "${ path . sep } "` ) ;
19+
20+ console . log ( `Path to current file is ${ __filename } ` ) ;
21+ console . log ( `Path to current directory is ${ __dirname } ` ) ;
22+
23+ const myServer = createServerHttp ( ( _ , res ) => {
24+ res . end ( 'Request accepted' ) ;
25+ } ) ;
26+
27+ const PORT = 3000 ;
28+
29+ console . log ( unknownObject ) ;
30+
31+ myServer . listen ( PORT , ( ) => {
32+ console . log ( `Server is listening on port ${ PORT } ` ) ;
33+ console . log ( 'To terminate it, use Ctrl+C combination' ) ;
34+ } ) ;
35+
36+ module . exports = {
37+ unknownObject,
38+ myServer,
39+ } ;
40+
Original file line number Diff line number Diff line change 1- console . log ( 'Hello from c.js !' ) ;
1+ console . log ( 'Hello from c.cjs !' ) ;
You can’t perform that action at this time.
0 commit comments