astro/docs/src/pages/quick-start.md

71 lines
2.2 KiB
Markdown
Raw Normal View History

2021-06-28 06:27:12 +00:00
---
layout: ~/layouts/MainLayout.astro
2021-06-28 06:27:12 +00:00
title: Quick Start
---
```shell
# prerequisite: check that Node.js is 12.20.0+, 14.13.1+, or 16+
node --version
# Make a new project directory, and navigate directly into it
mkdir my-astro-project && cd $_
2021-06-28 06:27:12 +00:00
# prepare for liftoff...
npm init astro
# install dependencies
npm install
# start developing!
npm run dev
2021-06-28 06:27:12 +00:00
# when you're ready: build your static site to `dist/`
npm run build
```
If you wish to learn more about the range of methods to install and setup Astro for your project's, please [read our installation guide.](installation)
2021-06-28 06:27:12 +00:00
## Start your project
From inside your project directory, enter the following command into your terminal:
2021-06-28 06:27:12 +00:00
```bash
npm run dev
2021-06-28 06:27:12 +00:00
```
Astro will now start serving your application on [http://localhost:3000](http://localhost:3000). Opening this URL in your browser, you should see the Astro's "Hello, World".
2021-06-28 06:27:12 +00:00
The server will listen for live file changes in your `src/` directory, so you do not need to restart the application as you make changes during development.
2021-06-28 06:27:12 +00:00
## Build your project
To build your project, from inside your directory enter the following build command into your terminal:
2021-06-28 06:27:12 +00:00
```bash
npm run build
```
This will instruct Astro to build your site and save it directly to disk. Your application is now ready in the `dist/` directory.
2021-07-28 15:43:09 +00:00
## Deploy your project
Astro sites are static, so they can be deployed to your favourite host:
- [Vercel](https://vercel.com/)
- [Netlify](https://www.netlify.com/)
- [S3 bucket](https://aws.amazon.com/s3/)
- [Google Firebase](https://firebase.google.com/)
- [Read more about deploying Astro in our Deploy guide.](/guides/deploy)
## Next Steps
Success! You're now ready to start developing!
We recommend that you to take some time to get more familiar with the way Astro works. You can do so by further exploring our Docs, we suggest that you consider the following:
📚 Learn more about Astro's project structure in our [Project Structure guide.](/core-concepts/project-structure)
📚 Learn more about Astro's component syntax in our [Astro Components guide.](/core-concepts/astro-components)
2021-07-27 14:36:32 +00:00
📚 Learn more about Astro's file-based routing in our [Routing guide.](core-concepts/astro-pages)