Giter Site home page Giter Site logo

kthecoder / godottpd Goto Github PK

View Code? Open in Web Editor NEW

This project forked from deep-entertainment/godottpd

0.0 0.0 0.0 92 KB

A routable HTTP server for Godot

Home Page: https://godotengine.org/asset-library/asset/1205

License: Other

GDScript 100.00%

godottpd's Introduction

GodotTPD

A routeable HTTP server for Godot.

This addon for the Godot engine includes classes to start an HTTP server which can handle requests to paths using a set of routers in the way ExpressJS works.

Basic workflow

Create a router class that extends HttpRouter. Overwrite the methods that handle the required HTTP methods required for the specific path:

extends HttpRouter
class_name MyExampleRouter


func handle_get(request, response):
	response.send(200, "Hello!")

This router would respond to a GET request on its path and send back a response with a 200 status code and the body "Hello!".

Afterwards, create a new HttpServer, add the router and start the server. This needs to be called from a node in the SceneTree.

var server = HttpServer.new()
server.register_router("/", MyExampleRouter.new())
add_child(server)
server.start()

Documentation

Further information can be found in the API documentation:

Issues and feature requests

Please check out the deep entertainment issue repository if you find bugs or have ideas for new features.

godottpd's People

Contributors

fenix-hub avatar dploeger avatar meaf75 avatar 3ddelano avatar monitz87 avatar rylydou 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.