I'd like to implement a simple REST server using Grapevine Plus and am following the examples provided on the wiki. I installed Grapevine Plus 3.0.4 via NuGet. I'm running the following code, but when I navigate to http://localhost:1234 via browser, or if I send a GET request via REST client browser plugin, all I get is a "Not found" response:
// Program.cs
static void Main(string[] args)
{
var server = new RESTServer();
server.Start();
Console.WriteLine("Press Enter to Continue...");
Console.ReadLine();
server.Stop();
}
// TestResource.cs
public sealed class TestResource : RESTResource
{
[RESTRoute]
public void HandleAllGetRequests(HttpListenerContext context)
{
this.SendTextResponse(context, "GET is a success!");
}
}
What am I missing?
As the code you've written looks fine (and still runs fine for me), I think you might be running up against this project naming issue in Grapevine 3.0.x.
This is no longer an issue in version 3.1.0, but for the older 3.0.x versions you need to make sure you don't include the word 'grapevine' in your assembly name.