This file contains hidden or 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
root = "." | |
tmp_dir = "tmp" | |
[build] | |
delay = 500 # ms |
This file contains hidden or 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
{ | |
"ignore": [ | |
".git", | |
"node_modules/**/node_modules" | |
], | |
"delay": "500" | |
} |
This file contains hidden or 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
func main() { | |
// initialization codes | |
app.Get("/verify/:status/:role/:userId", authenticate, authorize, func(c *fiber.Ctx) { | |
if c.Locals("isAuthenticated") == false { | |
c.Status(403) | |
c.Send("Unauthenticated. Please signup!") | |
return | |
} | |
c.Send("Redirecting " + c.Locals("redirectRoute").(string)) |
This file contains hidden or 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
function authenticate(req, res, next) { | |
if (req.params.status === "authenticated") { | |
req.isAuthenticated = true | |
} else { | |
req.isAuthenticated = false | |
} | |
next(); | |
} |
This file contains hidden or 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
/* | |
Route path: /users/:userId/books/:bookId | |
Request URL: http://localhost:3000/users/34/books/8989 | |
req.params: { "userId": "34", "bookId": "8989" } | |
*/ | |
app.Get("/users/:userId/books/:bookId", func(c *fiber.Ctx) { | |
c.JSON(fiber.Map{ | |
"userId": c.Params("userId"), | |
"bookId": c.Params("bookId"), | |
}) |
This file contains hidden or 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
/* | |
Route path: /users/:userId/books/:bookId | |
Request URL: http://localhost:3000/users/34/books/8989 | |
req.params: { "userId": "34", "bookId": "8989" } | |
*/ | |
app.get('/users/:userId/books/:bookId', function (req, res) { | |
res.send(req.params) | |
}) |
This file contains hidden or 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 createError = require('http-errors'); | |
var express = require('express'); | |
var path = require('path'); | |
var cookieParser = require('cookie-parser'); | |
var logger = require('morgan'); | |
var indexRouter = require('./routes/index'); | |
var usersRouter = require('./routes/users'); | |
var app = express(); |
This file contains hidden or 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
package main | |
import ( | |
"gofiber/starter/routes" | |
"github.com/gofiber/fiber" | |
"github.com/gofiber/logger" | |
"github.com/gofiber/template" | |
) |
This file contains hidden or 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 'package:flutter/material.dart'; | |
import 'package:flutter_i18n_plugin/generated/i18n.dart'; | |
void main() async { | |
runApp(App()); | |
} | |
class App extends StatefulWidget { | |
@override |
This file contains hidden or 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 'dart:async'; | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
// ignore_for_file: non_constant_identifier_names | |
// ignore_for_file: camel_case_types | |
// ignore_for_file: prefer_single_quotes | |
//This file is automatically generated. DO NOT EDIT, all your changes would be lost. |
NewerOlder