Skip to content

Commit

Permalink
Revert "deleted exampleCode"
Browse files Browse the repository at this point in the history
This reverts commit 7eb051a.
  • Loading branch information
Til Wessel authored and Til Wessel committed Mar 14, 2018
1 parent c810814 commit 26042d4
Show file tree
Hide file tree
Showing 81 changed files with 11,326 additions and 0 deletions.
29 changes: 29 additions & 0 deletions react-native-fast-image-example-server/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
const path = require('path')
const express = require('express')
const bodyParser = require('body-parser')
const morgan = require('morgan')

const app = express()

const port = process.env.PORT || 8080
const welcome = 'Test images API at http://localhost:' + port
console.log(welcome)

app.use(bodyParser.urlencoded({ extended: false }))
app.use(bodyParser.json())
app.use(morgan('dev'))
app.get('/', (req, res) => res.send(welcome))
app.listen(port)

const authentication = (req, res, next) => {
const token = req.query.token || req.headers['token']
if (token) {
next()
} else {
return res.status(403).send({ success: false })
}
}

const staticPictures = express.static(path.join(__dirname, 'pictures'))

app.use('/pictures', authentication, staticPictures)
15 changes: 15 additions & 0 deletions react-native-fast-image-example-server/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "react-native-fast-image-example-server",
"version": "1.0.0",
"license": "MIT",
"main": "index.js",
"scripts": {
"start": "nodemon ./index"
},
"dependencies": {
"body-parser": "^1.17.1",
"express": "^4.15.2",
"morgan": "^1.8.1",
"nodemon": "^1.11.0"
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 26042d4

Please sign in to comment.