Coder Social home page Coder Social logo

dummy-employee-api's Introduction

Employee Management Program

The Employee Management Program is a JavaScript-based application that allows you to manage employee details. It provides basic CRUD (Create, Read, Update, Delete) operations for employee records, and the data is stored in a JSON file.

Features

  • Get a list of all employees
  • Get an employee by ID
  • Create a new employee record
  • Update an existing employee record
  • Delete an employee record

Requirements

  • Node.js
  • npm or yarn (package managers)

Installation

  1. Clone the repository:

    git clone https://github.com/azimsai/dummy-employee-api.git
    cd employee-management-program
    npm install
    or
    yarn install

    Usage

    Start the API server:

      node index.js
    
    

    The server will start running on http://localhost:3000.

You can use tools like cURL or Postman to interact with the API endpoints:

Get all employees: GET /employees

Get an employee by ID: GET /employees/:id

Create a new employee: POST /employees

Update an existing employee: PUT /employees/:id

Delete an employee: DELETE /employees/:id

Upload employee avatar : POST /employees/:id/avatar

Get employee avatar : GET /employees/:id/avatar

Note: Replace :id with the actual employee ID.

Data Persistence The employee data is stored in a JSON file named employees.json. The server reads the data from this file at startup and writes the data to the file whenever there are changes (e.g., adding, updating, or deleting an employee).

Validation The program performs validation on the employee data to ensure that the required fields are provided and have valid formats. Invalid data will result in appropriate error messages and status codes.

License This project is licensed under the MIT License.

dummy-employee-api's People

Contributors

azimsai avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.