Skip to content

Commit

Permalink
Updating app files
Browse files Browse the repository at this point in the history
  • Loading branch information
tarsislimadev committed Jan 2, 2025
1 parent caa3d6d commit b87569d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tests/index.sh
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
timeout 60 node index.js
timeout 60 node test-01.js

timeout 60 node test-02.js
2 changes: 1 addition & 1 deletion tests/index.js → tests/test-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ const server = new Server()

server.get('/', (req, res) => res.setJSON({ id: Date.now() }))

server.listen(80).then(() => fetch('http://localhost:80')).then((res) => res.json()).then((json) => console.log({ json }))
server.listen(80).then(() => fetch('http://localhost:80')).then((res) => res.json()).then((json) => console.log({ port: 80, json }))
11 changes: 11 additions & 0 deletions tests/test-02.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// index.js

import { Server } from 'abackend'

const server = new Server()

server.get('/', (req, res) => res.setJSON({ id: Date.now() }))

server.listen(80).then(() => fetch('http://localhost:80')).then((res) => res.json()).then((json) => console.log({ port: 80, json }))

server.listen(8080).then(() => fetch('http://localhost:8080')).then((res) => res.json()).then((json) => console.log({ port: 8080, json }))

0 comments on commit b87569d

Please sign in to comment.