Giter Club home page Giter Club logo

server-less's Introduction

Server "Less"

Simple and stupid REST service to fetch logs from the machine the service runs on

Usage

The service worked on my machine™ with Node v20.11. I don't see any reson for it not to run in any recent-ish version of Node

Installation

Run npm install to have dependencies installed

Running the service

Run npm start in the console.

There are a few tests for the file reader part, you can run them with npm test

API

Service has 2 simple endpoints

  • GET /files - returns a list of files available in the logs directory (/var/log/ by default)
  • GET /logs/{fileName} - reads lines from the specified log file. Lines will be returned in the new-to-old order

More detailed API documentation will be available at http://localhost:3000/api-docs/ when service runs

Using API

Swagger UI is also a good way to test the service, hit "Try it out" button and make requests with parameters you want

Code style

If you feel inclined to change the code. This repo uses StandardJS style.

server-less's People

Contributors

istepura 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.