![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/ahmad-ali14/restaurant-supplier-api
the api is live on: https://restaurant-supplier-api--ahmadali5.repl.co/
live with the front end: https://restaurant-supplier.netlify.app/
mongodb Atlas
for storing data, go
as a language, reple.it
for deployment.go
, files and packages names camelcased, this may cause you probrlems with linux based os, but it's fine with windows.users, restaurants, suppliers, orders
{
"_welcome ": {
"info": "resturant-supplier-api endpoints by Ahmad Ali"
},
"route / ": {
"Available Methods": "GET only",
"more info": "no authentication yet",
"this endpoint": "will give you more info about the Available routes by this api"
},
"route /order ": {
"Available Methods": "CRUD",
"this endpoint": "CRUD on orders"
},
"route /restaurant ": {
"Available Methods": "CRUD",
"this endpoint": "CRUD on restaurnts"
},
"route /supplier ": {
"Available Methods": "CRUD",
"this endpoint": "CRUD on suppliers"
}
}
{
"email":"mc@london.uk",
"password":"london"
}
and you will get this result:
{
"role": "restaurant",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJjbGllbnQiOiJFbGxpb3QgRm9yYmVzIiwiZXhwIjoxNTk3MDE4NzUwfQ.0PPK73nbjSDNwRKc3OJBo_PCPo61ZGgV8CEUpXSEZC0",
"userAccount": [
{
"Key": "_id",
"Value": "5f1ed376741bfdfe5ba916ad"
},
{
"Key": "name",
"Value": "MC Donalds London 1"
},
{
"Key": "address",
"Value": "nw"
},
{
"Key": "email",
"Value": "mc@london.uk"
},
{
"Key": "role",
"Value": "restaurant"
}
],
"userId": "5f1ed376741bfdfe5ba916ad"
}
Token
to your request so you will be authorized.{
"email":"mc3@london.uk",
"password":"lodon"
}
and you will get this result:
{
"role": "supplier",
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhdXRob3JpemVkIjp0cnVlLCJjbGllbnQiOiJFbGxpb3QgRm9yYmVzIiwiZXhwIjoxNTk3MDE4OTM0fQ.Up8sKj6RF5OSjam1KCFWTAiSmp_a0BKKujeiyGeHFCs",
"userAccount": [
{
"Key": "_id",
"Value": "5f1f3ee4cfedf9af9b6bdd08"
},
{
"Key": "email",
"Value": "mc3@london.uk"
},
{
"Key": "address",
"Value": "mc1"
},
{
"Key": "phone",
"Value": "+123435"
},
{
"Key": "role",
"Value": "supplier"
},
{
"Key": "products",
"Value": [
[
{
"Key": "productName",
"Value": "pr 1"
},
{
"Key": "productPrice",
"Value": "1"
}
],
[
{
"Key": "productName",
"Value": "pr 2"
},
{
"Key": "productPrice",
"Value": "2"
}
],
[
{
"Key": "productName",
"Value": "pr 3"
},
{
"Key": "productPrice",
"Value": "3"
}
]
]
}
],
"userId": "5f1f3ee4cfedf9af9b6bdd08"
}
Token
to your request so you will be authorized.make a ./config/config.go
file
put this code in that file:
package config
func GetMongoUrl() string {
return "<your mongodb connection string>"
}
if you face this error:
this means that your connection to db taking too long, just increase the context time of your connection.
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.