Skip to content

Instantly share code, notes, and snippets.

View GeekyGeeky's full-sized avatar

Geeky ~ Tech Concierge GeekyGeeky

View GitHub Profile
import { defineNuxtPlugin } from '#app'
import axios from 'axios'
import { useAuthStore } from '~/stores/auth'
export default defineNuxtPlugin(({ $pinia }) => {
return {
provide: {
axios: ({ use_auth }: Record<string, any> = {}) => {
let headers = { 'Content-Type': 'application/json' };
if (use_auth) {
Theme(
// use themedata to alter the styling of the child widgets
data: ThemeData(primarySwatch: Colors.purple),
child: Builder(builder: (c) {
return FlatProgressButton(
onPressed: () async {
_paystackDialog(c);
},
<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
include_once '../config/database.php';
<?php
// required headers
header("Access-Control-Allow-Origin: *");
header("Content-Type: application/json; charset=UTF-8");
header("Access-Control-Allow-Methods: POST");
header("Access-Control-Max-Age: 3600");
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
include_once '../config/database.php';
include_once '../objects/product.php';