Code Monkey home page Code Monkey logo

task-server's Introduction

Getting Started

The server expects a PostgreSQL database running on localhost. The database should be called "task-server" and the username and password should both be "taskadmin".

See https://www.postgresql.org/docs/current/tutorial-install.html

$ createdb --owner taskadmin task-server

The server will create any necessary tables at runtime.

$ cargo run --release

The server will listen for incoming http connections on port 3000.

Rest API

GET /

List tasks.

Accepts query params "page_size", "page", "task_type", "task_state"

"page_size" limits the number of tasks returned. Defaults to 10.

"page" is a 0-based index of pages. Defaults to 0.

"task_type" is one of ("Foo", "Bar", "Baz")

"task_state" is one of ("Scheduled", "Running", "Completed")

POST /

Create a task.

Expects a JSON body of the form

{ "task_type": "Foo|Bar|Baz", "execution_time": "2023-05-17T20:25:27Z" }

GET /:id

Get a task by id.

DELETE /:id

Delete a task by id.

task-server's People

Contributors

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