Skip to content

Commit

Permalink
Change port.
Browse files Browse the repository at this point in the history
  • Loading branch information
viferga committed Jan 9, 2025
1 parent 6beecd4 commit 54f21c0
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ jobs:
run: |
set -x
docker build -t metacall/nodejs-c-liburing-example .
docker run -p 8000:8000 --name metacall_test -d metacall/nodejs-c-liburing-example
docker run -p 28977:28977 --name metacall_test -d metacall/nodejs-c-liburing-example
sleep 10
docker ps
curl localhost:8000 || exit 1
docker logs metacall_test
curl localhost:28977 || exit 1
# until [ "`docker inspect -f {{.State.Health.Status}} metacall_test`" == "healthy" ]; do
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ COPY scripts/uring.c scripts/script.ld /home/scripts/
ENV LOADER_LIBRARY_PATH=/usr/local/lib \
LOADER_SCRIPT_PATH=/home/scripts

EXPOSE 8000
EXPOSE 28977

# HEALTHCHECK --interval=1s --timeout=3s --start-period=1ms \
# CMD curl localhost:8000 || exit 1
# CMD curl localhost:28977 || exit 1

CMD [ "metacallcli", "/root/index.js" ]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ sum(3, 4) # 7

We will be avoiding all the boilerplate and we will have a single interface for all languages. The calls will be also type safe and we will avoid a lot of errors and time for maintaining the wrappers for each language that we can spend focusing on the development.

In this example we want to bring the power of `io_uring` to NodeJS for maximizing the speed of I/O and outperform NodeJS native primitives like `http` module. For demonstrating it, we have a `server_listen` function which creates a simple HTTP server in the port `8000`.
In this example we want to bring the power of `io_uring` to NodeJS for maximizing the speed of I/O and outperform NodeJS native primitives like `http` module. For demonstrating it, we have a `server_listen` function which creates a simple HTTP server in the port `28977`.

## Docker

Building and running with Docker:

```bash
docker build -t metacall/nodejs-c-liburing-example .
docker run --rm -p 8000:8000 -it metacall/nodejs-c-liburing-example
docker run --rm -p 28977:28977 -it metacall/nodejs-c-liburing-example
```

## Accessing to the website

Just go to your web browser and enter this url: `localhost:8000`
Just go to your web browser and enter this url: `localhost:28977`
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ const { metacall, metacall_load_from_file } = require('metacall');

metacall_load_from_file('c', ['uring.c', 'script.ld']);

metacall('server_listen', 8000);
metacall('server_listen', 28977);

0 comments on commit 54f21c0

Please sign in to comment.