server.js 553 B

12345678910111213141516171819202122232425
  1. var express = require('express')
  2. var path = require('path');
  3. var bodyParser = require('body-parser')
  4. const app = express();
  5. app.use(bodyParser.json());
  6. app.use(bodyParser.urlencoded({ extended: true }));
  7. app.use(express.static(path.join(__dirname, 'build')))
  8. // app.get('/auth/check', (req, res) => {
  9. // if (req.cookie) {
  10. // return true
  11. // } else {
  12. // return false
  13. // }
  14. // })
  15. app.get('/*', (req, res) => {
  16. res.sendFile(path.join(__dirname, 'build', 'index.html'))
  17. })
  18. app.listen(5000, () => {
  19. console.log('ok')
  20. })