mirror of
https://github.com/stronk-dev/RandomChad.git
synced 2025-07-05 18:35:10 +02:00
19 lines
342 B
JavaScript
19 lines
342 B
JavaScript
const express = require( 'express' )
|
|
const cors = require( 'cors' )
|
|
const bodyParser = require('body-parser')
|
|
|
|
// CORS enabled express generator
|
|
module.exports = f => {
|
|
|
|
// Create express server
|
|
const app = express()
|
|
|
|
// Enable CORS
|
|
app.use( cors( { origin: true } ) )
|
|
|
|
// Enable body parser
|
|
app.use( bodyParser.json() )
|
|
|
|
return app
|
|
|
|
} |