Skip to content

elyse502/API-SIMPLE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

👨‍💻 Simple clean nodeJS API 🛜

A simple clean REST API built with NodeJS, express with a n-tier architecture (organized into layers).




Setting Up 🏗️

  • Make sure you have NodeJS v14 or newer innstalled.
  • Run npm ci to install all dependencies.
  • npm start to start your API on port 4000.
    • You can change the port by editing src/server.js and changing const port = 4000; to another port number.
  • Download Insomnia or Postman to send easily HTTP requests to your API.




Running unit tests 🛠️

npm test

Or with npx

npx ava




Running it with Podman ⚓

  1. Make sure Podman is correctly installed on your machine - https://podman.io/getting-started/installation
  2. From a command line opened , run podman machine init, and then podman machine start
  3. Then, in the project folder (still from your terminal), let's build the image with podman build -t simple-api-image .
  4. Once it has finished and the image successfully built, you should be able to see it by typing podman images
  5. Finally, let's run the image container by typing podman run -p 4000:4000 simple-api-image - Here, we use port 4000, and map it to the local port 4000.




3rd-party libraries 🔗

To make our job easier, this API uses the some great handy libraries such as...




Author ✒️

LinkedIn @phenrysay pH-7




License 📝

This project is distributed under MIT license. Enjoy! 🎉




Releases

No releases published

Packages

No packages published