Look at the Nuxt 3 documentation to learn more.
Make sure to install the dependencies:
# npm
npm install
Install serverless framework
# serverless
npm install -g serverless
Start the development server on http://localhost:3000
npm run dev
Configure AWS CLI credentials https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html
Create AWS s3 bucket and publish into cloudfront https://aws.amazon.com/es/premiumsupport/knowledge-center/cloudfront-serve-static-website/
In the file nuxt.config.ts update the url of the cloudfront distribution
// https://nuxt.com/docs/api/configuration/nuxt-config
export default defineNuxtConfig({
modules: [
'@nuxtjs/tailwindcss',
'nuxt-security'
],
app: {
cdnURL: "https://MI_CDN",
}
})
Build the application for production:
npm run build
Copy the public files to s3 created
aws s3 cp ./.output/public s3://MI_BUCKET_CREADO --recursive
Deploy Server to a Serverless Function
serverless deploy
TODO: Agregar comandos para crear un cloudfront delante del API Gateway
Locally preview production build:
npm run preview
Check out the deployment documentation for more information.