-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
Description
Hi, just experimenting. Found that the code won't display all the records when used without the /1
This seemed because it was trying to do a SELECT * WHERE id="NULL"
so I stuck the following code in:
switch (req.method) {
case 'GET':
if (key === "NULL") {
sql = "select * from " + table;
}
else {
sql = "select * from " + table + (key ? " where id=" + key : '');
}
break;
Hope this makes sense.
There may be a more elegant way :)
ps I just want to say thanks for all the work you have done on this project - I've found it very useful for my personal projects and learning about RESTful services. Thanks.
Reactions are currently unavailable