https://github.com/emanuelefavero/node-basics
This is a simple Node.js project that demonstrates the basic features of Node.js.
https://github.com/emanuelefavero/node-basics
api http middleware node nodejs
Last synced: 6 months ago
JSON representation
This is a simple Node.js project that demonstrates the basic features of Node.js.
- Host: GitHub
- URL: https://github.com/emanuelefavero/node-basics
- Owner: emanuelefavero
- License: mit
- Created: 2024-04-24T13:24:28.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-04-25T12:03:56.000Z (over 1 year ago)
- Last Synced: 2025-02-04T16:50:25.721Z (8 months ago)
- Topics: api, http, middleware, node, nodejs
- Language: JavaScript
- Homepage:
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Node.js Basics
This is a simple Node.js project that demonstrates the basic features of Node.js.
> Note: I tried to only use built in Node.js modules when possible to only showcase Node.js features (e.g. avoiding `express`)
## How to run the project
1. Clone the project and `cd` into the project directory
2. Run `npm install`- To run the `router` example, run `npm run router`
- To run the `api` example, run `npm run api`> Note: You can also add an environment variable `PORT` to specify the port number. The default port is `4000`.
## Test the project
### Router
- Open a browser and navigate to `http://localhost:4000/`
### API
- Open a browser and navigate to `http://localhost:4000/api/users` or `http://localhost:4000/api/users/1` and so on
> You could also test the API using `curl`, `Postman` or the `*.http` files in the root directory
>
> Note: To run the `*.http` files, you need to install the [Rest Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) extension in VS Code### FS
- Run `npm run fs` to test the `fs` module
### Path
- Run `npm run path` to test the `path` module
### OS
- Run `npm run os` to test the `os` module
### URL
- Run `npm run url` to test the `url` module
### Crypto
- Run `npm run crypto` to test the `crypto` module
### Events
- Run `npm run events` to test the `events` module
### Process
- Run `npm run process` to test the `process` object
## Resources
- [Node.js](https://nodejs.org/)
- [Node.js Docs](https://nodejs.org/en/docs/)## License
- [MIT](LICENSE.md)