Skip to content

Instantly share code, notes, and snippets.

View ArnaudBuchholz's full-sized avatar
🏠
Working from home

Arnaud Buchholz ArnaudBuchholz

🏠
Working from home
View GitHub Profile
{
"port": 8080,
"mappings": [{
"match": "^/$",
"file": "./webapp/static.html"
}, {
"match": "^/(.*)",
"file": "./webapp/$1"
}]
}
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>OpenUI5 Demo App</title>
<script id="sap-ui-bootstrap"
src="https://openui5.hana.ondemand.com/1.76.0/resources/sap-ui-core.js"
data-sap-ui-theme="sap_fiori_3"
data-sap-ui-libs="sap.m"
data-sap-ui-resourceroots='{"Demo": "./"}'
require('reserve/mock')({
port: 8080,
mappings: [{
match: /^\/(.*)/,
file: path.join(__dirname, '$1')
}]
})
.then(mocked => mocked.request('GET', '/'))
.then(response => {
assert(response.statusCode === 200)
{
"use": "express-session",
"options" : {
"secret": "keyboard cat",
"resave": false,
"saveUninitialized": true
}
}
module.exports = async (request, response) => response.setHeader('Access-Control-Allow-Origin', '*')
{
"custom": "./cors.js"
}
{
"match": "^/proxy/(https?)/(.*)",
"url": "$1://$2"
}
const { serve } = require('reserve')
serve({ /* configuration */ })
.on('ready', ({ url }) => {
console.log(`Server running at ${url}`)
})
const { check } = require('reserve')
check({
port: 8080,
mappings: [{
/* ... */
}]
}).then(configuration => /* ... */)