• 카테고리

    질문 & 답변
  • 세부 분야

    프론트엔드

  • 해결 여부

    미해결

http://localhost:3000/ 하면 404에러가 납니다.

23.09.07 15:36 작성 조회수 305

0

npx lite0server --baseDir 1-vanilla

터미널에서 실행 후, localhost:3000접속하면

Cannot GET / 이라고 뜨고 개발자도구에는 404에러라고 뜹니다.

 

터미널에도 404 에러구요.. 어떻게 하면 화면 띄울수있을까요?

Did not detect a `bs-config.json` or `bs-config.js` override file. Using lite-server defaults...
** browser-sync config **
{
  injectChanges: false,
  files: [ './**/*.{html,htm,css,js}' ],
  watchOptions: { ignored: 'node_modules' },
  server: {
    baseDir: './',
    middleware: [ [Function (anonymous)], [Function (anonymous)] ]
  }
}
[Browsersync] Access URLs:
 --------------------------------------
       Local: http://localhost:3000
    External: http://192.168.0.102:3000
 --------------------------------------
          UI: http://localhost:3001
 UI External: http://localhost:3001
 --------------------------------------
[Browsersync] Serving files from: ./
[Browsersync] Watching files...
23.09.07 15:29:32 404 GET /index.html
23.09.07 15:29:35 404 GET /index.html
23.09.07 15:33:58 404 GET /index.html

답변 1

답변을 작성해보세요.

0

zohee23님의 프로필

zohee23

질문자

2023.09.08

npx lite0server --baseDir 1-vanilla 실행을 cd 1-vanilla 후에 하니까 화면이 뜨네요. 문제해결했습니다.

캡쳐해주신것 보면 기본 폴더가 1-vanilla로 지정되지 않은것 같아보여요.

말씀하신대로 해당 폴더로 이동하신뒤에 명령어 실행하시면 될것 같네요. 폴더에서 명령어 실행하실때는 npx lite-server만 실행해도 될거게요.