www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - vibe.d no routes match path

reply seany <seany uni-bonn.de> writes:
Please consider the code:


import vibe.vibe;
import std.conv;
import std.file;
import std.stdio;


ushort port   =  5502;






void main(char[][] args)
{

         auto router = new URLRouter;
         router.post("/archive", &savedata);
         router.get("/archive", &savedata); //also tested without 
this line

         auto settings = new HTTPServerSettings;
         settings.port = port;
         settings.bindAddresses = ["::1", "0.0.0.0"];
         listenHTTP(settings, router);

         runApplication();
}

void savedata(HTTPServerRequest req, HTTPServerResponse res) {


        // do things
                 return;

         }


This was working fine until yesterday

Today, it says (after a dub build) : 404 - Not Found

Not Found

Internal error information:
No routes match path '/a'

This is a production server. Is there anything i am doing wrong?
Feb 04 2020
next sibling parent seany <seany uni-bonn.de> writes:
* sorry, i meant 'archive'
 This is a production server. Is there anything i am doing wrong?
Feb 04 2020
prev sibling parent Steven Schveighoffer <schveiguy gmail.com> writes:
On 2/4/20 10:35 AM, seany wrote:
          router.post("/archive", &savedata);
          router.get("/archive", &savedata); //also tested without this
line
[snip]
 Internal error information:
 No routes match path '/a'
Did you go to /a? Looks like you only registered routes for /archive. -Steve
Feb 04 2020