This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const handler = (request: Request): Response => { | |
const body = 'Hello World\n'; | |
return new Response(body, { status: 200 }); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { serve } from "https://deno.land/std@0.145.0/http/server.ts"; | |
const port = 8080; | |
const handler = (request: Request): Response => { | |
const body = 'Hello World\n'; | |
return new Response(body, { status: 200 }); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use Illuminate\Http\Request; | |
use App\Models\User; | |
use Illuminate\Support\Facades\URL; | |
class ManagementController extends Controller | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// we imagine the ( sccaned ) is array of scaned items the function will be like : | |
<?php | |
$sccaned = array("atv", "atv", "atv", "vga", "ipd", "ipd", "ipd", "ipd", "ipd"); | |
$atv_price = 109.50; | |
$mbp_price = 1399.99; | |
$vga_price = 30.00; | |
$ipd_price = 549.99; | |
$size = sizeof($sccaned); | |
for ($x = 0; $x <= $size; $x++) { | |
if ($sccaned[$x] == "atv") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JSON Example | |
{ | |
"employees": [ | |
{ | |
"name": "John Crichton", | |
"gender": "male" | |
}, | |
{ | |
"name": "Kmal Sun", | |
"gender": "female" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var koa = require('koa'); | |
var jwt = require('koa-jwt'); | |
var app = koa(); | |
app.use(jwt({ | |
secret: 'very-secret' | |
})); | |
// Protected middleware |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET : http://mywebsite.com/api/users ( fetching data ) | |
POST : http://mywebsite.com/api/users/2 ( deleting data ) | |
UPDATE : http://mywebsite.com/api/users/1 ( updating data ) | |
PUT : http://mywebsite.com/api/users ( insert/add datat ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo "Hello world" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html lang="en-US"> | |
<head> | |
<meta charset="UTF-8"> | |
<title></title> | |
<link rel="stylesheet" href="style.css" /> | |
</head> | |
<body> | |
<div class="container"> |