Skip to content

Commit

Permalink
Merge pull request #87 from permaweb/mu-changes
Browse files Browse the repository at this point in the history
Mu changes enable cors
  • Loading branch information
VinceJuliano authored Oct 9, 2023
2 parents 6f74d68 + 159f8b5 commit 77f1fdc
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
10 changes: 3 additions & 7 deletions servers/mu/src/domain/lib/crank/crank.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,9 @@ function crankListWith ({ processMsg, processSpawn, logger }) {
// Process spawns when the recursion terminates
if (ctx.spawns && ctx.spawns.length > 0) {
for (const spawn of ctx.spawns) {
try {
await of({ cachedSpawn: spawn })
.chain(processSpawn)
.toPromise()
} catch (e) {

}
await of({ cachedSpawn: spawn })
.chain(processSpawn)
.toPromise()
}
}

Expand Down
2 changes: 2 additions & 0 deletions servers/mu/src/middleware/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import bodyParser from 'body-parser'
import cors from 'cors'

import errors from './errors/errors.js'

Expand All @@ -12,6 +13,7 @@ function injectDomain (req, _res, next) {
}

const mountMiddlewares = (app) => [
cors(),
bodyParser.json(),
bodyParser.urlencoded({ extended: false }),
injectDomain,
Expand Down
34 changes: 34 additions & 0 deletions servers/testscripts/src/test-su.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
// const fs = require('fs')
// const path = require('path')

// globalThis.MU_URL = 'http://localhost:3004'
// globalThis.CU_URL = 'http://localhost:3005'
// const { createDataItemSigner } = require('@permaweb/ao-sdk')

// const CONTRACT_TX_ID = 'uJFN44vrnt4aLb4hBtfBryY-2z3ag_Us-e896ZaJxHM'
// const SEQUENCER_URL = 'http://localhost:9000'

// (async function () {
// console.log('Testing ao...')

// const walletPath = process.env.PATH_TO_WALLET

// const walletKey = JSON.parse(fs.readFileSync(path.resolve(walletPath), 'utf8'))
// const signer = createDataItemSigner(walletKey)

// const input = { function: 'noop' }
// const tags = []

// const response = await fetch(
// `${SEQUENCER_URL}/write`,
// {
// method: 'POST',
// headers: {
// 'Content-Type': 'application/octet-stream',
// Accept: 'application/json'
// },
// body: rawDataBuffer
// }
// )

// })()

0 comments on commit 77f1fdc

Please sign in to comment.