Sample todo app in React
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

15 рядки
472B

  1. const express = require('express')
  2. const path = require('path')
  3. const port = process.env.PORT || 3000
  4. const app = express()
  5. // serve static assets normally
  6. app.use(express.static(path.join(__dirname, '../client/public')))
  7. // Handles all routes so you do not get a not found error
  8. app.get('*', function (request, response){
  9. response.sendFile(path.resolve(__dirname, '../client/public', 'index.html'))
  10. })
  11. app.listen(port)
  12. console.log("server started on port " + port)