Skip to content

Commit

Permalink
Enable CORS support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ava's DAO committed Dec 20, 2023
1 parent d984b6b commit c0d5949
Show file tree
Hide file tree
Showing 15 changed files with 629 additions and 916 deletions.
9 changes: 4 additions & 5 deletions oracles/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ services:
build: .
image: oracles
container_name: oracles
restart: always
restart: unless-stopped
network_mode: 'host'
# ports:
# - '127.0.0.1:3000:3000'
environment:
- COUCHDB_USER=${COUCHDB_USER} # change this to match your system's ENV
- COUCHDB_PASSWORD=${COUCHDB_PASSWORD} # change this to match your system's ENV
logging: # apply better controls to Docker overlay folder
driver: 'json-file'
options:
max-file: '5'
max-size: '10m'
environment:
- PROJECT_ID=${PROJECT_ID} # change to match your own environment
- PROJECT_NAME=${PROJECT_NAME} # change to match your own environment
- PROJECT_MNEMONIC=${PROJECT_MNEMONIC} # change to match your own environment
42 changes: 4 additions & 38 deletions oracles/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,70 +1,36 @@
<script setup lang="ts">
useHead({
title: 'PROJECT_NAME — Nexa Studio',
title: 'Oracles — Nexa Exchange',
meta: [
{ name: 'description', content: 'Nexa Studio makes building your next BIG idea effortless.' }
{ name: 'description', content: 'Accountable and verifiable price & data oracles.' }
],
})
/* Initialize stores. */
import { useProfileStore } from '@/stores/profile'
import { useSystemStore } from '@/stores/system'
import { useWalletStore } from '@/stores/wallet'
const Profile = useProfileStore()
const System = useSystemStore()
const Wallet = useWalletStore()
onBeforeMount(() => {
// TODO Move this block to @nexajs/app
try {
Profile.$state = JSON.parse(localStorage.getItem('profile'), (key, value) => {
if (typeof value === 'string' && /^\d+n$/.test(value)) {
return BigInt(value.slice(0, value.length - 1))
}
return value
})
System.$state = JSON.parse(localStorage.getItem('system'), (key, value) => {
if (typeof value === 'string' && /^\d+n$/.test(value)) {
return BigInt(value.slice(0, value.length - 1))
}
return value
})
Wallet.$state = JSON.parse(localStorage.getItem('wallet'), (key, value) => {
if (typeof value === 'string' && /^\d+n$/.test(value)) {
return BigInt(value.slice(0, value.length - 1))
}
return value
})
// add additional states here...
} catch (err) {
console.error(err)
}
})
// TODO Move this block to @nexajs/app
watch([Profile.$state, System.$state, Wallet.$state], (_state) => {
localStorage.setItem('profile',
JSON.stringify(_state[0], (key, value) =>
typeof value === 'bigint' ? value.toString() + 'n' : value
)
)
watch(System.$state, (_state) => {
localStorage.setItem('system',
JSON.stringify(_state[1], (key, value) =>
JSON.stringify(_state, (key, value) =>
typeof value === 'bigint' ? value.toString() + 'n' : value
)
)
localStorage.setItem('wallet',
JSON.stringify(_state[2], (key, value) =>
typeof value === 'bigint' ? value.toString() + 'n' : value
)
)
// watch additional states here...
})
// onMounted(() => {
Expand Down
5 changes: 4 additions & 1 deletion oracles/nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ export default defineNuxtConfig({
meta: [
{ charset: 'utf-8' },
{ name: 'viewport', content: 'width=device-width, initial-scale=1' },
{ name: 'description', content: 'Accountable and verifiabe data oracles.' },
{ name: 'description', content: 'Accountable and verifiable price & data oracles.' },
],
link: [
{ rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' },
],
script: [
{ src: '/js/matomo.js' },
],
},
baseURL: '/oracles',
},
Expand Down
6 changes: 3 additions & 3 deletions oracles/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nexajs-nuxt-ts",
"version": "0.0.0",
"name": "nexa-exchange-oracles",
"version": "23.12.20",
"license": "MIT",
"scripts": {
"build": "nuxt build",
Expand All @@ -11,7 +11,7 @@
},
"dependencies": {
"@pinia/nuxt": "0.4.7",
"nexajs": "23.8.21",
"nexajs": "23.12.13",
"nuxt": "3.0.0",
"pinia": "2.0.32"
},
Expand Down
Loading

0 comments on commit c0d5949

Please sign in to comment.